#include #include #include using namespace std; int main() { // Declare variables to hold ticket data int price, tickets, sales, x; // Declare file stream variables ifstream fIn; ofstream fOut; // Open input/output files fIn.open("F:\\ticket-sales\\tickets.txt"); fOut.open("F:\\ticket-sales\\output.txt"); // Grab input from the file for (int x = 0; x < 4;) { x++; fIn >> price >> tickets; sales = price * tickets; } // Set required output formatting cout << fixed << showpoint << setprecision(2) << endl; fOut << "Price: " << price << ", Tickets: " << tickets << ", Sales: " << sales << endl; fIn.close(); fOut.close(); return 0; }