PJ 4 – Temperature Table Please write a C++ program that will get 7 temperatures in Fahrenheit from the user, convert them to 7 temperatures in Celsius respectively, and then print a table of 7 temperatures from Fahrenheit to Celsius. All the temperatures in the output must show only one decimal digit after the decimal point. The temperature conversion formulas are as follows: 9. T =;(T;- 32) and T;=T+32 %3D
#include <iostream>// include library to access input output stream: cin cout
#include <iomanip> // include library to access output manipulators: setw(35) setprecision(2)using namespace std; // Access cout, endl, cin using standard namespace without using std::
int main() // integer function main() should return integer to the caller.
{
cout << "Welcome to the Temperature Tool of Layla !\n" << endl << endl;
double tf1, tf2, tf3, tf4, tf5, tf6, tf7; // temperature F, 7 of them, don’t use float
double tc1, tc2, tc3, tc4, tc5, tc6, tc7; // temperature C, 7 of them, don’t use float
cout << "Please enter 7 temperatures in Fahrenheit: " ; // prompt input from the user
cin >> tf1 >> tf2 >> tf3 >> tf4 >> tf5 >> tf6 >> tf7 ; // get 7 input values
//// need help here to convert all 7 F-temperatures// to C-temperatures, and then print a table for them. ////
cout << endl << "Thank you for using the Temperature Tool of Layla!\n" << endl;
int quit; // declare integer variable quit // You must use your name here
cout << "To really quit this game, please enter a number: " << endl;
cin >> quit; // get the input from user // so you have time to do screenprint
return 0; // return zero to indicate a successful completion of main functio
} // end main ( ) function // end of C++ program =============================.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images