subject
Engineering, 06.03.2020 20:50 Serenitybella

The manager of a football stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets—box, sideline, premium, and general admission. After each game, data is stored in a file in the following form:ticketPrice numberOfTicketsSold...Sample data are shown below:250 5750100 2800050 3575025 18750The first line indicates that the ticket price is $250 and that 5750 tickets were sold at that price. Output the total number of tickets sold and the total sale amount into an output file. Format your output with two decimal places. (You are required to generate an output file that has the results.)So far my answer is#include #include #include using namespace std;int main() { double total = 0; int nTickets = 0; std::ifstream infile("tickets. txt"); int a, b; while (infile >> a >> b) { total = a*b; nTickets = nTickets + b; } cout << "Total Sale amount: " << total << endl; cout << "Number of tickets sold: " << setprecision(2) << nTickets << endl; system("pause"); return 0;}

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Aflywheel accelerates for 5 seconds at 2 rad/s2 from a speed of 20 rpm. determine the total number of revolutions of the flywheel during the period of its acceleration. a.5.65 b.8.43 c. 723 d.6.86
Answers: 2
question
Engineering, 04.07.2019 18:10
During a steady flow process, the change of energy with respect to time is zero. a)- true b)- false
Answers: 2
question
Engineering, 04.07.2019 18:10
An air compression refrigeration system is to have an air pressure of 100 psia in the brine tank and an allowable air temperature increase of 60°f for standard vapor compression cycle temperatures of 77 f entering the expansion cylinder and 14 f entering the compression cylinder, calculate the coefficient of performance a. 2.5 b 3.3 c. 4.0 d. 5.0
Answers: 3
question
Engineering, 04.07.2019 18:20
Inspection for bearing condition will include: (clo4) a)-color b)-smell c)-size d)-none of the above
Answers: 1
You know the right answer?
The manager of a football stadium wants you to write a program that calculates the total ticket sale...
Questions
question
Mathematics, 31.12.2019 19:31
Questions on the website: 13722363