// This program illustrates output to a file. Notice that the file // L4_2.OUT will be created by this program if it doesn't exist already. #include #include void main() { double income, expenses; int week, year; ofstream outfile("./L4_2.OUT"); cout << "Enter income, expenses: "; cin >> income >> expenses; cout << "Enter week, year: "; cin >> week >> year; outfile << "Week = " << week << endl << "Year = " << year << endl; outfile << "Income = " << income << endl; outfile << "Expenses = " << expenses << endl; outfile.close(); }