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

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 19:10, nayi2002
The short distance from the objective lens to the object causes problems at high magnification. which of the following is the most serious? a. cleaning the object surface b. positioning the object c. reflection from the object surface. d. illumination of the object
Answers: 1
image
Engineering, 04.07.2019 19:10, thawkins79
Agas contained within a piston-cylinder assembly e end nation about same energy states, 1 and 2, where pi 10 bar, v undergoes two processes, a and b, between the sam 0.1 m3, ui-400 kj and p2 1 bar, v2 1.0 m2, u2 200 kj: process a: process from 1 to 2 during which the pressure- volume relation is pv constant process b: constant-volume process from state 1 to a pressure of 2 bar, followed by a linear pressure-volume process to +20 0 state 2 kinetic and potential energy effects can be ignored. for each of the processes a and b, (a) sketch the process on p-v coordinates, (b) evaluate the work, in kj, and (c) evaluate process the heat transfer, in kj
Answers: 2
image
Engineering, 04.07.2019 19:20, GusGus11
The power source in a certain welding setup generates 3500w that is transferred to the low carbon steel work with a heat transfer factor of 0.85. the melting factor in the operation is 0.45. a continuous fillet weld is to be made with a cross-sectional area of 23 mm2 determine the travel speed at which the welding can be accomplished.
Answers: 3
image
Engineering, 06.07.2019 02:30, cofran
A75mm diameter shaft is supported in a journal bearing 75mm long with a diametral clearance of 0. 1mm. it supports a radial load of 1000 n and is lubricated with sae 50 oil at 70°c. find the friction torque and the power loss when the crankshaft rotates at 2900 rev/min.
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 in other subjects:

Konu
Mathematics, 06.11.2019 06:31