Computers and Technology
Computers and Technology, 25.11.2021 05:20, elmo4851

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 05:00, bellad0124outlookcom
In cell b18, enter a formula to calculate the amount budgeted for meals. this amount is based on the daily meal allowance and the total travel days (# of nights+1).
Answers: 1
image
Computers and Technology, 23.06.2019 10:30, tommyaberman
Would a ps4 wired controller work on an xbox one
Answers: 1
image
Computers and Technology, 23.06.2019 14:00, savannnab1890
Select the correct answer. andre was recently hired by an organization to check for system vulnerabilities. he is supposed to exploit these vulnerabilities and create a report on the extent of damage to which the system was susceptible. what position does andre hold in this organization? a. information security analyst b. information assurance manager c. penetration tester d. network security engineer e. chief information security officer
Answers: 2
image
Computers and Technology, 24.06.2019 14:30, danielweldon1234
When workers demonstrate patience, are able to manage there emotions, and get along with other employees, which skills are being displayed?
Answers: 1
Do you know the correct answer?
This program will convert a set of temperatures from Fahrenheit to Celsius and Kelvin. Your progra...

Questions in other subjects:

Konu
Mathematics, 28.01.2022 07:00
Konu
Computers and Technology, 28.01.2022 07:00