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;=3T.+32 %3D

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

#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; 

main.cpp: In function 'int main()':
main.cpp:11:13: error: expression cannot be used as a function
tc1=5(tf1-32)/9;
main.cpp:12:13: error: expression cannot be used as a function
tc2=5 (tf2-32)/9;
Transcribed Image Text:main.cpp: In function 'int main()': main.cpp:11:13: error: expression cannot be used as a function tc1=5(tf1-32)/9; main.cpp:12:13: error: expression cannot be used as a function tc2=5 (tf2-32)/9;
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:
5
9.
T. =;(Tf-32) and
Tf = T+32
Transcribed Image Text: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: 5 9. T. =;(Tf-32) and Tf = T+32
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY