Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#include #include #include using namespace std; int main ( ) { ifstream inputFile; ofstream outputFile; inputFile.open ( FahrenheitTemperature . txt ) ; if
#include
#include
#include
using namespace std;
int main
ifstream inputFile;
ofstream outputFile;
inputFile.openFahrenheitTemperaturetxt;
if inputFile.isopen
cout "Unable to open the input file." endl;
return ;
outputFile.openCelciusTemperaturetxt;
Open the output file
ofstream outputFileCelsiusTemperaturetxt;
if outputFile.isopen
cout "Unable to open the output file." endl;
inputFile.close;
return ;
Read the data from the input file
string city;
double temp;
while inputFile city temp
double celsius temp ;
outputFile city celsius deg C endl;
Close the files
inputFile.close;
outputFile.close;
cout "Temperature conversion complete. Output file created." endl;
return ;
Is the code correct because I keep getting "Unable to open the input file" even though I put it in the same directory where the solution is
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started