10.3k views
5 votes
There are three seating categories at a stadium for a softball game, class a seats cost$15, class b seats costs $12, and class c seats costs $9. Design a modular program that asks how many tickets for each class of seats were sold, and then displays the amount of income generated from ticket sales.

User Marstone
by
7.8k points

1 Answer

4 votes
#include

using namespace std;

int main(){
int ticketsA, ticketsB, ticketsC;
double income;

cout << "Enter number of Class A tickets sold: ";
cin >> ticketsA;

cout << "Enter number of Class B tickets sold: ";
cin >> ticketsB;

cout << "Enter number of Class C tickets sold: ";
cin >> ticketsC;

income = ticketsA*15 + ticketsB*12 + ticketsC*9;

cout << "Income generated from ticket sales: $" << income;

return 0;
}
User Dkimot
by
7.9k points