The program reads the input from an input file named sales.txt and - TopicsExpress



          

The program reads the input from an input file named sales.txt and prints the output to the monitor. The first line of the input file contains the column headers and must be ignored. The succeeding lines contain the actual date. The output includes column headers in the first line, the monthly employee sales bonus and the total bonus of each employee. #include #include using namespace std; int main(){ ifstream infile; ofstream outfile; char inputfilename[30]; int sentinel; char inp1[30] = "Input 1"; float inp2 = 0, inp3 =0, inp4 = 0; float totalval=0; infile.open("c:\temp\inputfile.txt"); outfile.open("c:\temp\outputfile.txt"); if (infile.is_open() && outfile.is_open()){ infile >> sentinel; outfile > inp2 >> inp3 >> inp4; inp2 = inp2 * 0.10; inp3 = inp3 * 0.10; inp4 = inp4 * 0.10; totalval = inp2 + inp3 + inp4; outfile
Posted on: Tue, 20 Aug 2013 01:16:41 +0000

Trending Topics



Recently Viewed Topics




© 2015