Modify the previous version of this program so that it uses a loop to display a range of temperature conversions for either Fahrenheit to Celsius or Celsius to Fahrenheit.
Note: You can start with the code from the previous version, then modify it slightly after it prompts the user for the direction to convert. It will then ask the user for a starting temperature and ending temperature. Assuming they entered the lower number first (if not, tell them and end the program), loop through the range provided, incrementing by 1 for each iteration of the loop, and generate the appropriate table.
The output should look like this:
Temperature Conversion Table
Enter c (or C) to convert Fahrenheit to Celsius
or f (or F) to convert Celsius to Fahrenheit: F
Enter the starting temperature: 30
Enter the ending temperature: 42
Celsius Fahrenheit
30 86.0
31 87.8
32 89.6
33 91.4
34 93.2
35 95.0
36 96.8
37 98.6
38 100.4
39 102.2
40 104.0
41 105.8
42 107.6
Running the program again:
Temperature Conversion Table
Enter c (or C) to convert Fahrenheit to Celsius
or f (or F) to convert Celsius to Fahrenheit: c
Enter the starting temperature: -4
Enter the ending temperature: 4
Fahrenheit Celsius
-4 -20.0
-3 -19.4
-2 -18.9
-1 -18.3
0 -17.8
1 -17.2
2 -16.7
3 -16.1
4 -15.6