Question: PLEASE WRITE IN MATLAB. Write a script that will print a list consisting of C for temperature in degrees Celsius, F for temperature

PLEASE WRITE IN MATLAB.
Write a script that will print a list consisting of "C for temperature in degrees Celsius", "F for temperature in degrees Fahrenheit", and "K for temperature in degrees Kelvin". It prompts the user to choose one, and then prompts the user for a temperature. The script should then make the conversions and print the temperature in two others scales that has not been specified by the user. For example if the user choose C, the scripts should return temperatures in degrees Fahrenheit and Kelvin.
If the user enters an invalid choice, the script simply prints an error message. The script should use a nested if-else statement to accomplish this. For example, the followings illustrate 3 different scenarios: (red numbers or character indicate values or character entered by the user).
Scenario #1
C for temperature in degrees Celsius
F for temperature in degrees Fahrenheit
K for temperature in degrees Kelvin
Please choose one: a
Error! Not a valid choice.
Scenario #2
C for temperature in degrees Celsius
F for temperature in degrees Fahrenheit
K for temperature in degrees Kelvin
Please choose one: C
Enter the temperature in degrees Celsius: -14
The temperature in degrees Fahrenheit is: 6.80
and the temperature in degrees Kelvin is: 259.15
Scenario #3
C for temperature in degrees Celsius
F for temperature in degrees Fahrenheit
K for temperature in degrees Kelvin
Please choose one: K
Enter the temperature in degrees Kelvin: 300
The temperature in degrees Celsius is: 26.85
and the temperature in degrees Fahrenheit is: 80.33
The format of the output should be exactly as specified above. The conversions are:
F=95C+32
K=C+273.15
This means that for example both F and f should be accepted as the scale for degrees Fahrenheit.
Modify your script in question 3a to use the switch statement instead of else-if.
 PLEASE WRITE IN MATLAB. Write a script that will print a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!