//Chloe Yau CIC5 Chapter 3, P. 143, #2
//
/*******************************************************************************
*
* COMPUTE STADIUM SEATS
* _____________________________________________________________________________
* This program calculates how much money the stadium made from ticket sales for
* three classes of seats Class A, Class B, and Class C.
* _____________________________________________________________________________
* INPUT
* classA_price : Class A seats cost $15
* classB_price : Class B seats cost $12
* classC_price : Class C seats cost $9
* classA_tickets : Class A seats have 20
* classB_tickets : Class B seats have 30
* classC_tickets : Class C seats have 40
* OUTPUT
* total_income_A : Sales from section A
* total_income_B : Sales from section B
* total_income_C : Sales from section C
* total_income : Total income generated from ticket sales
*
******************************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
// Prices for each class of seats
const float classA_price = 15.00;
const float classB_price = 12.00;
const float classC_price = 9.00;
// Number of seats in each class (fixed values)
const int classA_seats = 20;
const int classB_seats = 30;
const int classC_seats = 40;
// Number of tickets sold for each class (hard-coded values)
int classA_tickets = 50; // Example value
int classB_tickets = 75; // Example value
int classC_tickets = 100; // Example value
// Variables to store the total income from ticket sales for each class
float total_income_A;
float total_income_B;
float total_income_C;
float total_income;
// Calculate the total income for each class
total_income_A = classA_tickets * classA_price;
total_income_B = classB_tickets * classB_price;
total_income_C = classC_tickets * classC_price;
// Calculate the total income from all tickets sold
total_income = total_income_A + total_income_B + total_income_C;
// Display the total income with 2 decimal places
cout << fixed << setprecision(2);
cout << "\nTotal income generated from Class A tickets: $" << total_income_A;
cout << "\nTotal income generated from Class B tickets: $" << total_income_B;
cout << "\nTotal income generated from Class C tickets: $" << total_income_C;
cout << "\nTotal income from all ticket sales: $" << total_income << endl;
return 0;
}