#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
using namespace std;
void greeting();
void getName();
int main ()
{
ifstream inputFile1, inputFile2;
ofstream outputFile;
string userInput, userInput2, data1, skip;
cout << "Supply the input file name to process." << endl;
cin >> userInput;
inputFile1.open(userInput.c_str());
if (inputFile1.fail())
{
cout << "The input file does not exist" << endl;
cout << "Exit the program and try again..." << endl;
return 0;
}
else
{
cout << "Supply the output file name to process." << endl;
cin >> userInput2;
inputFile2.open(userInput2.c_str());
}
if (inputFile2.fail())
{
cout << "The output file does not exist" << endl;
cout << "Exit the program and try again..." << endl;
return 0;
}
else
{
greeting();
getName();
while( !inputFile1.eof())
{
inputFile1 >> data1;
}
}
}
void greeting()
{
cout << "Joe's Grading Calculator" << endl;
cout << endl;
cout << "==================================================" << endl;
}
void getName()
{
ifstream inputFile1, inputFile2;
ofstream outputFile;
string userInput, userInput2, name, data1, skip;
int t = 1;
int tt = 1;
inputFile1.open(userInput.c_str());
inputFile2.open(userInput2.c_str());
outputFile << "Joe's Grading Calculator" >> endl; // Come back to this later to see if things look correct.
outputFile << endl;
outputFile << "==================================================" >> endl;
outputFile << endl;
while (t = tt)
{
inputFile1 >> name;
getline(inputFile1, name);
getline(inputFile1, skip);
outputFile << "Your name is: " << name << endl;
} |