Fahrenheit to Celsius Code

Hey guys, I'm new to any type of programming and for my computer science class we have to write a program to do the following:

 Loop 4 times to do the following
o Prompt the user to enter a degree in Fahrenheit.
o Convert the degree from Fahrenheit to Celsius.
o Output the data into a text file called outfile.dat


Our Instructor gave us this skeleton:

//Program Two key
// this program prompts the user to enter a value in Fahrenhiet and then
// it converts it to Celsius.

#include <iostream.h>
#include <conio.h>
#include <fstream.h>
#include <iomanip.h>

int main()
{
int i;
float far;

// setup the output data file

ofstream report("outfile.txt");

// send data to output file called outfile.dat

report << " " << endl;
report << " " << endl;
report << endl;
report << "Fahrenhiet Values entered by user and their equivalent Celsius Values" << endl;
report << endl;



// setup the for loop

for (i=1; i <= 4; i++)

{ // begin loop
// prompt user for a temprature in Fahrenhiet



// convert to celsius



// use c++ commands to include decimal point in output

report.setf(ios::fixed, ios::floatfield);
report.setf(ios::showpoint);

// output the data to the data file

report << setw(5) << i << setw(16) << setprecision(1) << far << endl;

} // end loop

report << endl;
report << "Entered by Ihssan Alkadi" << endl;
report.close(); // close data file
return 0;
} // end program

Any help would be greatly appreciated!

Thanks
Topic archived. No new replies allowed.