I don't understand C++

Help I don't know what to do.

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

I miss to see your problem... might go into greater detail what is unclear to you?

The beginning of the code is already given...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
File Name: 

A Program to: convert Fahrenheit to Centigrade

Programmer: 

Date Written: 

Date last revised:
*/

#include <iostream>

using namespace 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...
Last edited on
Topic archived. No new replies allowed.