Hello, I'm trying to create a looped program that collects celsius temperatures from a text file and does the calculation for all the numbers to be transformed into fahrenheit, but I keep on receiving compiler errors. This is my code so far:
#include <fstream>
#include <iostream>
#include <string>
#include <iomanip>
usingnamespace std;
int main()
{
ifstream fin;
fin.open("temps.txt");
if (!fin.good()) throw"I/O error";
double f; // degrees F
double c; // degrees C
cout << fixed << setprecision(1);
while (true)
{
if (!fin.good()) break;
getline(fin, c);
cout << "The temperature in degrees Celsius is " << c;
f = 9.0 / 5 * c + 32;
cout << "The temperature in degrees F is " << f << endl;
} // while
fin.close();
return 0;
} // main