Write a function that displays a menu that allows the user to do the following: (1):...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a function that displays a menu that allows the user to do the following: (1): Convert a temperature from Celsius to Fahrenheit using the formula F = (9/5) C+32. (2): Convert a temperature from Fahrenheit to Celsius using the formula C = (5/9) (F-32). (3): Quit the program. Read the choice from the user. If the user chose 1 or 2, first call a subroutine to get a temperature from the user. Then, pass the temperature as a parameter to the appropriate function and return the converted temperature. Output the returned converted temperature, and then display the menu once again. If the user chose 3, quit the program. A sample run is included below: >>> -- >>> 1. Fahrenheit to Celsius 2. Celsius to Fahrenheit 3. Quit Please select one of the above: 1 Please enter a Fahrenheit temperature: 212 212.00 Fahrenheit degrees is 100.00 Celsius degrees. 1. Fahrenheit to Celsius 2. Celsius to Fahrenheit 3. Quit Please select one of the above: 2 Please enter a Celsius temperature: 0 0.00 Celsius degrees is 32.00 Fahrenheit degrees. 1. Fahrenheit to Celsius. 2. Celsius to Fahrenheit 3. Quit RESTART Please select one of the above: 4 Please enter a valid choice. 1. Fahrenheit to Celsius 2. Celsius to Fahrenheit 3. Quit Please select one of the above: 3 >>> Write a function that displays a menu that allows the user to do the following: (1): Convert a temperature from Celsius to Fahrenheit using the formula F = (9/5) C+32. (2): Convert a temperature from Fahrenheit to Celsius using the formula C = (5/9) (F-32). (3): Quit the program. Read the choice from the user. If the user chose 1 or 2, first call a subroutine to get a temperature from the user. Then, pass the temperature as a parameter to the appropriate function and return the converted temperature. Output the returned converted temperature, and then display the menu once again. If the user chose 3, quit the program. A sample run is included below: >>> -- >>> 1. Fahrenheit to Celsius 2. Celsius to Fahrenheit 3. Quit Please select one of the above: 1 Please enter a Fahrenheit temperature: 212 212.00 Fahrenheit degrees is 100.00 Celsius degrees. 1. Fahrenheit to Celsius 2. Celsius to Fahrenheit 3. Quit Please select one of the above: 2 Please enter a Celsius temperature: 0 0.00 Celsius degrees is 32.00 Fahrenheit degrees. 1. Fahrenheit to Celsius. 2. Celsius to Fahrenheit 3. Quit RESTART Please select one of the above: 4 Please enter a valid choice. 1. Fahrenheit to Celsius 2. Celsius to Fahrenheit 3. Quit Please select one of the above: 3 >>>
Expert Answer:
Answer rating: 100% (QA)
To meet the requirements mentioned in the provided question we need to write a Python function that ... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
: (i) What data structures are maintained by the page manager. (ii) What happens when a machine performs a read operation to a page. (iii) What happens when a machine performs a write operation to a...
-
llustrate different ways of connecting these components together to span a range of performance requirements. [10 marks] For each of the performance categories that you identify state today's typical...
-
The following sequences of bits (rightmost bit first) appear at the inputs of a 4-bit parallel adder. Determine the resulting sequence of bits on each output. A1 1 0 0 1 A2 1 1 1 0 A3 0 0 0 0 A4 1 0...
-
Early in 2014, Laird Industries was formed with authorization to issue 150,000 shares of $20 par value common stock and 10,000 shares of $100 par value cumulative preferred stock. During 2014, all...
-
A sample consisting of 100 employees has been given a manual-dexterity test. Given the accompanying frequency distribution, determine the approximate mean and standard deviation for these data. Data...
-
A TMS (transcranial magnetic stimulation) device creates very rapidly changing magnetic fields. The field near a typical pulsed-field machine rises from \(0 \mathrm{~T}\) to \(2.5 \mathrm{~T}\) in...
-
For August, Royal Consulting and Mediation Practice (RCMP) worked 900 hours for Alberta Company and 2,100 hours for Ontario Corporation. RCMP bills clients at the rate of $300 per hour; labor cost...
-
What is the altitude angle of the sun for someone at Houston 34 'N on the Summer solstice, which is June 21?
-
James borrows 60000 dollars from a bank that charges interest at an annual rate of 8 percent, compounded monthly. Calculate the monthly payment that James would have to make in order for the loan to...
-
Dominique, who is a scrum master, uses planning poker to estimate user stories. After going through the first user story details, Dominique asked her team members to choose a card as an estimate of...
-
Andrea is a single child under 18 with $3,500 of interest income and no earned income. What is Andrea's net unearned income?
-
Given 9 elements: {x1, x2, x3, X4, X5, X6, x7, x8, x9}, it is known that x5 is not in place. What is the maximum number of inversions in this array?
-
Umbrella Co's gross profit margin increased from 41.5% in year 1 to 44.3% in year 2. Possible reasons may include: 1. Cost of obsolete product passed on to the customer. 2. Use of early payment...
-
The Grist Mill just paid a dividend of $3.46 per share on its stock. The dividends are expected to grow at a constant rate of 4.5 percent per year, indefinitely. What will the price of this stock be...
-
Select a Malaysian listed company. Download the 2019 annual report of the company and search information via the internet and newspaper related to the selected company. Conduct Internal analysis and...
-
What are conversion costs? What are prime costs?
-
Repeat Programming Project 10 from Chapter 5 but use an array to store the movie ratings instead of separate variables. All changes should be internal to the class, so the main method to test the...
-
Create a program that tests the class Android described in the previous exercise. Previous exercise. Create a class Android whose objects have unique data. The class has the following attributes:...
-
Repeat the previous programming project, but read the input data from a file and send the output to another file. If you have covered binary files, use binary files; otherwise, use text files. Read...
-
Draw a cash flow diagram of any investment that exhibits both of the following properties: 1. The investment has a 4-year life. 2. The investment has a 10 percent/year internal rate of return.
-
What is the internal rate of return of the following cash flow diagram? a. 20 percent b. 18.2 percent c. 17.5 percent d. 15 percent $30 $31 0 1 2 3 $30 $15
-
Quilts R Us (QRU) is considering investing in a new patterning attachment with the cash flow profile shown in the table below. QRU's MARR is 13.5 percent/year. a. What is the internal rate of return...
Study smarter with the SolutionInn App