For this lab, you must be able to write up a source file, compile, link, and execute the program.
You must write a C++ language program that meets the following specifications:
The program must prompt the user for a temperature in Fahrenheit:
and output the corresponding Centigrade temperature using the following formula:
C=5/9(F-32)
Be sure to insert spaces in the output for readability.
Setup your header comments at the beginning of the source file as follows:
/*
File Name: the name of your source code file goes here
A Program to: explain what your program does here
Programmer: “Your Name Goes Here”
Date Written: today’s date
Date last revised: when you last revised the code
*/
#include <iostream> // need cin, cout and endl
using namespace std;
etc.
N.B. Be carefull with mixing integers and doubles in a formula. Remember an integer divided by an integer does not have a fractional part, i.e. 5 / 2 = 2 not 2.5
Your program must work correctly with any double input value for Fahrenheit.
Your code must be well structured and it must have comments
/*
File Name:
A Program to: convert Fahrenheit to Centigrade
Programmer:
Date Written:
Date last revised:
*/
#include <iostream>
usingnamespace std;
int main()
{
return 0;
}
Just use cout to ask the user for his/her input, use cin to get it into a double (because of the fractional part) and then rewrite the double into Centigrade with the formula given above... Then you just need to display it with cout...