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=²C+32 K=C+273.15 Modify your script in question 3a to accept both lower case and upper case letters. 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. S

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
please answer 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 = 2C+32
5
K=C+273.15
QURA
Modify your script in question 3a to accept both lower case and upper case letters.
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.
Transcribed Image Text: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 = 2C+32 5 K=C+273.15 QURA Modify your script in question 3a to accept both lower case and upper case letters. 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.
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY