Question: Write a program that displays a table of the Celsius temperatures 0 thru 20 and their Fahrenheit equivalents. The formula for converting a temperature from

Write a program that displays a table of the Celsius temperatures 0 thru 20 and their Fahrenheit equivalents. The formula for converting a temperature from Celsius to Fahrenheit is: F = 9/5C + 32 Where F is the Fahrenheit temperature and C is the Celsius temperature. Your program must use a for loop to display the table. Hint 1: Use doubles (not ints) so the calculation is evaluated correctly (remember dividing an int by an int yields an int, which is not what we want). Hint 2: Use Math.round (which returns a long not an int) to display only the whole number. Example: Math.round(10.2) returns 10 Sample Output:

Centigrade ------------ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Fahrenheit ----------- 32 34 36 37 39 41 43 45 46 48 50 52 54 55 57 59 61 63 64 66 68

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!