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 03:10
What precautions should you take to prevent injuries when dealing with heavy loads?
Answers: 1
question
Engineering, 04.07.2019 18:10
Afour cylinder four-stroke in-line engine has a stroke of 160mm, connecting rod length of 150mm, a reciprocating mass of 3kg and its firing order is 1-3-4-2. the spacing between cylinders is 100mm. i. show that the engine is in balance with regard to the primary inertia forces and primary 3. a and secondary inertia couples. li determine the out of balance secondary inertia force ii. propose ways of balancing this out of balance force and discuss the challenges that will arise
Answers: 3
question
Engineering, 04.07.2019 18:10
Water at 55c flows across a flat plate whose surface temperature is held constant at 95c. if the temperature gradient at the plate's surface for a given value of x is 18 c/mm, find a) local heat transfer coefficient. b) heat flux
Answers: 3
question
Engineering, 04.07.2019 18:20
Aquick transition of the operating speed of a shaft from its critical speed will whirl amplitude. (a) increase (b) limit (c) not affect (d) zero
Answers: 2
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
History, 25.07.2019 02:30
Questions on the website: 13722363