The input of your test case #1 must be: 32 50 68 77 95 100 212. The output of your test case #1 must look exactly as follows including the data. You must also do test case #2 and test case #3 with different input data of your choices. Each test case or test run must begin with a welcome message, and must end with a thank-you message. Welcome to the Temperature Tool of Dr. Simon Lin! E You must use your name! Please enter 7 temperatures in Fahrenheit: 32 50 68 77 95 100 212 degree F degree C 0.0 10.0 32.0 50.0 68.0 20.0 77.0 25.0 95.0 35.0 100.0 37.8 212.0 100.0 Thank you for using the Temperature Tool of Dr. Simon Lin! + You must use your name!
This is the code I have so far. it gives me an error that says
"main.cpp: In function ‘int main()’: main.cpp:11:13: error: expression cannot be used as a function tc1=5(tf1-32)/9;"
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
cout << "Welcome to the Temperature Tool of Layla!\n" << endl << endl;
double tf1, tf2, tf3, tf4, tf5, tf6, tf7;
double tc1, tc2, tc3, tc4, tc5, tc6, tc7;
cout << "Please enter 7 temperatures in Fahrenheit: " ;
cin >> tf1 >> tf2 >> tf3 >> tf4 >> tf5 >> tf6 >> tf7 ;
tc1=5(tf1-32)/9;
tc2=5(tf2-32)/9;
tc3=5(tf3-32)/9;
tc4=5(tf4-32)/9;
tc5=5(tf5-32)/9;
tc6=5(tf6-32)/9;
tc7=5*(tf7-32)/9;
cout <<"degree F" <<setw(35) << "degree C" <<endl;
cout <<fixed<< setprecision(1)<<tf1 <<setw(35)<<fixed << setprecision(1)<< tc1 <<endl;
cout <<fixed<< setprecision(1)<<tf2 <<setw(35)<<fixed << setprecision(1)<< tc2 <<endl;
cout <<fixed<< setprecision(1)<<tf3 <<setw(35)<<fixed << setprecision(1)<< tc3 <<endl;
cout <<fixed<< setprecision(1)<<tf4 <<setw(35)<<fixed << setprecision(1)<< tc4 <<endl;
cout <<fixed<< setprecision(1)<<tf5 <<setw(35)<<fixed << setprecision(1)<< tc5 <<endl;
cout <<fixed<< setprecision(1)<<tf6 <<setw(35)<<fixed << setprecision(1)<< tc6 <<endl;
cout <<fixed<< setprecision(1)<<tf7 <<setw(35)<<fixed << setprecision(1)<< tc7 <<endl;
cout << endl << "Thank you for using the Temperature Tool of Layla!\n" << endl;
int quit;
cout << "To really quit this game, please enter a number: " << endl;
cin >> quit;
return 0;
}
Step by step
Solved in 3 steps with 1 images