I want my C++ program to read all the inputs I've written in a .txt file and show me the output i want for each input. i basically want the program to run on each of my inputs, instead, it's only reading my first input. i want it to loop for each set of info i provide. Here is what i have so far:
#include<iostream>
#include<cmath>
#include<iomanip>
#include<string>
#include<fstream>
using namespace std;
int main()
{
ifstream fin;
ofstream fout;
fin.open("emp.txt");
fout.open("output.dat");
string last, first;
double salary, increase, nsalary;
while (fin>>last>>first>>salary>>increase);
{
nsalary= salary + ((salary/100.0)*increase);
fout<<first<<"\t"<<last<<"\t"<<fixed<<showpoint<<setprecision(3)<<salary<<"\t\t"<<nsalary;
cout<<first<<"\t"<<last<<"\t"<<fixed<<showpoint<<setprecision(3)<<salary<<"\t\t"<<nsalary;
fin.close();
fout.close();
}
}
Thank you