#include #include #include using namespace std; const int RESRATE = 80; const int STADRATE = 50; const int STANDRATE = 35; const float PRODPERCENT = 0.8; int main() { char name[80], filename[40]; int totalgross = 0; int res, stad, stand, gross; ifstream fin; ofstream fout; cout << "Enter file name to be processed: "; cin >> filename; fin.open(filename); if (fin.fail()) { cout << "**FILE NOT FOUND!\n"; return(0); } fout.open("f:\\report.txt"); { cout << "**COULD NOT CREATE REPORT FILE!\n"; return(0); } fin.getline(name, 80); fin >> res >> stad >> stand; while (res >= 0) { gross = res * RESRATE + stad * STADRATE + stand * STANDRATE; totalgross = totalgross + gross; fin >> res >> stad >> stand; } fout << setprecision(2) << fixed; fout << "Concert name: " << name << endl; fout << " Total Gross: $" << float(totalgross) << endl; fout << " Production costs: $" << totalgross * PRODPERCENT << endl; cout << "program done.\n"; return 0; }