Answer to Question #124368 in C++ for wilfred

Question #124368
2. Write a program that computes the total ticket sales of a concert . there are three types of seating’s : A, B, and C. the program accepts the number of tickets sold and the price of a ticket for each of the three types of seats. The total sales are computed as
totalSales = numberofA_Seats * priceperA_Seat +
numberofB_Seats * priceperB_Seat +
numberofC_Seats * priceperC_Seat ;
Write this program, using only one class, the main class of the program
1
Expert's answer
2020-06-29T08:18:16-0400
#include <iostream>


int main() {
	std::cout << "How many type A tickets sold?" << std::endl;
	int numberofA_Seats;
	std::cin >> numberofA_Seats;
	std::cout << "How much does one such ticket cost?" << std::endl;
	int priceperA_Seat;
	std::cin >> priceperA_Seat;


	std::cout << "How many type B tickets sold?" << std::endl;
	int numberofB_Seats;
	std::cin >> numberofB_Seats;
	std::cout << "How much does one such ticket cost?" << std::endl;
	int priceperB_Seat;
	std::cin >> priceperB_Seat;


	std::cout << "How many type C tickets sold?" << std::endl;
	int numberofC_Seats;
	std::cin >> numberofC_Seats;
	std::cout << "How much does one such ticket cost?" << std::endl;
	int priceperC_Seat;
	std::cin >> priceperC_Seat;


	int  totalCost = numberofA_Seats * priceperA_Seat +
		numberofB_Seats * priceperB_Seat +
		numberofC_Seats * priceperC_Seat;


	std::cout << "Total cost: " << totalCost << std::endl;


	system("pause");
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Assignment Expert
02.07.20, 13:17

Dear Cole, Questions in this section are answered for free. We can't fulfill them all and there is no guarantee of answering certain question but we are doing our best. And if answer is published it means it was attentively checked by experts. You can try it yourself by publishing your question. Although if you have serious assignment that requires large amount of work and hence cannot be done for free you can submit it as assignment and our experts will surely assist you.

cole
01.07.20, 13:36

Briefly explain the roles of Instruction Registers and Program Counters.

Assignment Expert
29.06.20, 15:46

Dear Qweku, You're welcome. We are glad to be helpful. If you liked our service please press like-button beside answer field. Thank you!

Qweku
28.06.20, 18:40

I learnt a lot from your page , it is very helpful

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS