|
# include <iostream> # include <fstream> // add additional header files you use using namespace std ;
int main() { // Declare file stream variables ifstream inData; int ticketPrice, ticketsSold, ticketTotal; double totalSale; //Open the files inData.open("data.text");//open the input file; //code for data manipulation //loop
ticketPrice = inData.open("data.text"); ticketsSold = inData.open; ticketTotal = ticketsSold; totalSale = ticketPrice * ticketsSold;
ticketPrice = inData.open; ticketsSold = inData.open; ticketTotal = ticketsSold; totalSale += ticketPrice * ticketsSold;
ticketPrice = inData.open; ticketsSold = inData.open; ticketTotal += ticketsSold; totalSale += ticketPrice * ticketsSold;
ticketPrice = inData.open; ticketsSold = inData.open; ticketTotal += ticketsSold; totalSale += ticketPrice * ticketsSold;
cout<<"Total Sales " + totalSale; cout<<"Total Tickets Sold " + ticketTotal;
//close files inData.close();
// output the totals //Pause the system so the user can see the output system ("Pause");
return 0; } // end of main
|