Answer to Question #124413 in C++ for Adomako

Question #124413
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-30T08:01:47-0400
#include <iostream>


int main() {
	std::cout << "Enter number of A seats: ";
	int numberofA_Seats;
	std::cin >> numberofA_Seats;
	std::cout << "Enter price per A seat: ";
	int priceperA_Seat;
	std::cin >> priceperA_Seat;


	std::cout << "Enter number of B seats: ";
	int numberofB_Seats;
	std::cin >> numberofB_Seats;
	std::cout << "Enter price per B seat: ";
	int priceperB_Seat;
	std::cin >> priceperB_Seat;


	std::cout << "Enter number of C seats: ";
	int numberofC_Seats;
	std::cin >> numberofC_Seats;
	std::cout << "Enter price per C seat: ";
	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

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS