lightnin6776 0 Newbie Poster

This is what I have so far the teacher wants us to request the file name and I have no clue where to even start. Thank you for the help!

#include <iostream>
#include <string>
#include <fstream>
#include <cmath>
#include <iomanip>


using namespace std;

int main() 


   ifstream inFile;
   ofstream outFile;

   string firstName;
   string lastName;

   double currentSal;
   double payInc;

  inFile.open("Ch3_Ex5Data.txt");
  outFile.open("Ch3_Output.dat");



outFile << fixed << showpoint << setprecision(2);

inFile >> lastName >> firstName;
inFile >> currentSal >> payInc;
outFile <<  firstName << " " << lastName << " " <<  ((currentSal + currentSal * (payInc / 100)));
outFile << endl;

inFile >> lastName >> firstName;
inFile >> currentSal >> payInc;
outFile <<  firstName << " " << lastName << " " << ((currentSal + currentSal * (payInc / 100)));
outFile << endl;

inFile >> lastName >> firstName;
inFile >> currentSal >> payInc;
outFile <<  firstName << " " << lastName << " " << ((currentSal + currentSal * (payInc / 100)));
outFile << endl;



inFile.close();
outFile.close();
cin.get();


return 0;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.