subject

This program will convert a set of temperatures from Fahrenheit to Celsius and Kelvin. Your program will be reading in three double values. The first values are starting and ending temperatures. The third value is the increment value. There is no prompt for the input. There is an error message that can be displayed. This is discussed later.
You need to display output for all of the values between the starting and ending values. First two values are temperatures in Fahrenheit. You need to display all of the values from the first temperature to the last temperature. You increment from one temperature to the next by the increment value (the third value you read in). You need to convert these temperatures to Celsius and Kelvin. You need to output the temperatures as Fahrenheit, Celsius, and Kelvin. The numbers should be 18 characters wide with 4 digits of precision and need to be in fixed format. Do not use tab characters (\t) to output the values.
The headings are also required (see the sample output below).
The conversion from Fahrenheit to Celsius is:
celsius = (fahrenheit - 32) / 1.8
The conversion from Celsius to Kelvin is:
kelvin = celsius + 273.15
Here is a sample run with valid input:
-30 100 20
The output would be:
Fahrenheit Celsius Kelvin
-30.0000 -34.4444 238.7056
-10.0000 -23.3333 249.8167
10.0000 -12.2222 260.9278
30.0000 -1.1111 272.0389
50.0000 10.0000 283.1500
70.0000 21.1111 294.2611
90.0000 32.2222 305.3722
For data validation you need to make sure the first number read in is less than or equal to the second number. The third number read in must be greater than 0. If this is not the case you need to output the following message and read in three new values:
Starting temperature must be <= ending temperature and increment must be > 0.0
The above message is all one line of output.
You need to keep reading in values and outputting messages until the values are all valid.
Using the following input :
40 30 5 30 40 -5 30 40 5
We get the output:
Starting temperature must be <= ending temperature and increment must be > 0.0 Starting temperature must be <= ending temperature and increment must be > 0.0
Fahrenheit Celsius Kelvin
30.0000 -1.1111 272.0389
35.0000 1.6667 274.8167
40.0000 4.4444 277.5944
Depending on the value for the increment the ending temperature may not be reached. You need to display the temperatures where the value of the Fahrenheit temperature is less than or equal to the ending temperature.
Consider this input:
100.5 110.4 5
The valid output will be:
Fahrenheit Celsius Kelvin
100.5000 38.0556 311.2056
105.5000 40.8333 313.9833
The last Fahrenheit temperature output is 105.5. The next one would have been 110.5, but this is more than the ending temperature of 100.4. This is not an error condition. The output would be as above.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
Write a function so that the main program below can be replaced by the simpler code that calls function original main program: miles_per_hour = float( minutes_traveled = float( hours_traveled = minutes_traveled / 60.0 miles_traveled = hours_traveled * miles_per_hour print('miles: %f' % miles_traveled) sample output with inputs: 70.0 100.0 miles: 116.666667
Answers: 3
question
Computers and Technology, 22.06.2019 14:20
Consider a byte-addressable computer with 16mb of main memory, a cache capable of storing a total of 64kb of data and block size of 32 bytes. (a) how many bits in the memory address? (b) how many blocks are in the cache? (c) specify the format of the memory address, including names and sizes, when the cache is: 1. direct-mapped 2. 4-way set associative 3. fully associative
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
The basic work area of the computer is it screen that you when you first fire up your computer
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
To maintain clarity and focus lighting might be needed
Answers: 2
You know the right answer?
This program will convert a set of temperatures from Fahrenheit to Celsius and Kelvin. Your progra...
Questions
question
Mathematics, 27.05.2021 18:20
question
Mathematics, 27.05.2021 18:20
question
Mathematics, 27.05.2021 18:20
question
Mathematics, 27.05.2021 18:20
question
Mathematics, 27.05.2021 18:20
question
Mathematics, 27.05.2021 18:20
question
Mathematics, 27.05.2021 18:20
question
Mathematics, 27.05.2021 18:20
Questions on the website: 13722363