Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that will display a temperature conversion table. The user will input the beginning Fahrenheit temperature, the ending Fahrenheit temperature, and the temperature

Write a program that will display a temperature conversion table. The user will input the beginning Fahrenheit temperature, the ending Fahrenheit temperature, and the temperature increment for display in the table. The program should then convert and display the temperature results in the form Fahrenheit to Celsius. The formula for the conversion is as follows: Celsius = ( 5 / 9 ) * ( Fahrenheit 32 ) Your program should make use of the Scanner class, whichever you DID NOT use for Lab-2. Use the same class for BOTH input and output. Also, make sure to use formatting with the output. That is, be consistent with the number of decimal places used ( 2, 3, or 4 ). Hint, use the DecimalFormat class. Output: Left border, Fahrenheit temp, formatted value, vertical line, formatted Celsius, vertical border Faren. Celsius --------------------------- | 32.00 | 0.0000 | | etc. | etc. | . . . . | 212.00 | 100.0000 | --------------------------- Algorithm: - Perform program setup and initializations - Prompt the user and input the starting Fahrenheit temperature. - Prompt the user and input the ending Fahrenheit temperature. - Prompt the user and input the temperature increment. - Print out the table header - Loop through the range of temperatures and generate the table o Get the next Fahrenheit temperature o Calculate the corresponding temperature in Celsius. o Display/output the two temperatures o Increment to the next Fahrenheit temperature o Proceed with another iteration of the loop - Terminate the program. - Test, test, test, and test some more.

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

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions

Question

7.9 Determine how the final hiring decision is made.

Answered: 1 week ago

Question

2. Compare the sales and service departments at Auto World.

Answered: 1 week ago