Use C++ Please provide screenshot of code. please include every detail and a code that can be copied and pasted. Thank you! 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.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.4: A Case Study: Rectangular To Polar Coordinate Conversion
Problem 7E: (Simulation) Write a program to simulate the roll of two dice. If the total of the two dice is 7 or...
icon
Related questions
Question

Use C++

Please provide screenshot of code.

please include every detail and a code that can be copied and pasted.

Thank you!

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.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Algebraic Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr