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:

Respuesta :

Answer:

see explaination

Explanation:

#include<iostream>

#include<iomanip>

using namespace std;

int main()

{

double temp1,temp2,inc,cel;

int i=1;

while(i==1)

{

i=0;

cin>>temp1>>temp2>>inc;

if(temp2<temp1||inc<=0)

{

i=1;

cout<<"Starting temperature must be <= ending temperature and increment must be >0.0\n";

}

}

cout<<endl;

cout<<setw(15)<<"Fahrenheit"<<setw(15)<<"Celsius";

while(temp1<=temp2)

{

cel=(temp1-32)/1.8;

cout<<endl;

cout<<fixed<<setprecision(3)<<setw(15)<<temp1<<setw(15)<<cel;

temp1+=inc;

}

}

Please kindly check attachment for output.

Ver imagen kendrich
ACCESS MORE