Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MATLAB Your program should show a menu of 3 options to the user. The first option is to convert from Fahrenheit to Celsius. The second

MATLAB

Your program should show a menu of 3 options to the user. The first option is to convert from Fahrenheit to Celsius. The second option is to convert from Celsius to Fahrenheit. The third option is to quit your program. Choosing the first or second option means that your program should repeat the menu after the conversion. This way, the user can convert as many temperatures as he/she wants without having to start your program more than once.

Make sure to prompt the user for information, such as "please enter your choice: ". For the first two options, you will need to follow up with a prompt for the value to convert.

Once the user has entered this information, print the following to the screen: X degrees Fahrenheit converts to Y degrees Celsius. or, X degrees Celsius converts to Y degrees Fahrenheit. or, quitting The values for X and Y will change. X is the value that the user enters, and Y is the calculated value.

Use comments within the program to say how you handle any unexpected cases.

Your program should work for all possible inputs. Make sure that you test it with several different cases. For example, what if the input is given as a floating-point number, like 21.4? What if the user enters 0, -10, or 1000? How should your program handle the case where 1+2j is given as the input number? What should happen if the user enters a choice besides the three options?

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions