Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a script that tests whether the user can follow instructhions. It prompts the message; otherwise anx'. If the user enters anything other than an

image text in transcribed
Write a script that tests whether the user can follow instructhions. It prompts the message; otherwise anx'. If the user enters anything other than an x'. it prints an error the script does nothing The systolic and diastolic blood pressure readings are found when the heart is pumping and the heart is at rest, respectively. A biomedical experiment is being conducted only on participants whose blood pressure is optimal. This is defined as a systolic blood pressure less than 120 and a diastolic blood pressure less than 80. Write a script that will prompt for the systolic and diastolic blood pressures of a person, and will print whether or not that person is a candidate for this experiment. In chemistry, the pH of an aqueous solution is a measure of its acidity. The pH scale ranges from 0 to 14, inclusive. A solution with a pH of 7 is said to be neutral, a solution with a pH greater than 7 is basic, and a solution with a pH less than 7 is acidic. Write a script that will prompt the user for the pH of a solution, and will print whether it is neutral, basic, or acidic. If the user enters an invalid pH, an error message will be printed. In a script, the user is supposed to enter either a y'or 'n' in response to a prompt. The user's input is read into a character variable called "letter". The seript will print "OK, continuing if the user enters either a "y' or .Y., or it will print "OK, halting" if the user enters a "n, or N' or "Error if the user enters anything else. Put this statement in the script first: letter -input Enter your answer:".s) Write the script using a single nested if else statement (slssif clause is permitted) Write the seript from the previous exercise using a switch statement instead Write a for loop that will print the column of real numbers from 1.5 to 3.1 in steps of 0.2. 2, Write a function sumsteps2 that cakculates and returns the sum of I to n in steps of where n is an argument passed to the function. For example, if 11 is passed, it will return p3b5p7p9 p 11. Do this using a for loop. Calling the function will look like this: >> sumsteps2(11) 1. ans-36 7. Sales (in millions) from two different divisions of a company for the four quarters of 2012 are stored in vector variables, such as the following: div 1 = [4.2 3.8 3.7 3.8); div2 [252.7 3.1 3.3]: Using subplot, show side-by-side the sales figures for the two divisions. In one compare the two divis graph 8. The inverse of the mathematical constant e can be approximated as follows: 11 Write a script that will loop through values of n until the difference between the approximation and the actual value is less than 0.0001. The script should then print out the built-in value of e-1 and the approximation to four decimal places, and also print the value of n required for such accuracy 9. Write a script that will use the menu function to present the user with choices for functions "fix", "floor", and "ceil". Error-check by looping to display the menu until the user pushes one of the buttons (an error could occur if the user clicks on the "X" on the menu box, rather than pushing one of the buttons). Then, generate a random number and print the result of the user's function choice of that number (eg.fix(5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions