//Xinnuo Wang CS1A chapter 3 , P.143, #2
//
/*******************************************************************************
*
* Caculate Stadium Seating Income
*-------------------------------------------------------------------------------
* This program asks how many tickets for each class of seats were sold, then
* displays the amount of income generated from ticket sales.
*
* computation is based on the formula:
* Total = Numb1 x Unit price of ClassA+ Numb2 x Unit price of ClassB+Numb3 x Unit price of ClassC
*-------------------------------------------------------------------------------
* INPUT
* numb1 : The amount of solded class A seats
* numb2 : The amount of solded class B seats
* numb3 : The amount of solded class C seats
* unitPriceA : The unit price of class A seats.
* unitPriceB : The unit price of class B seats.
* unitPriceC : The unit price of class c seats.
* OUTPUT
* total : The amount of income generated from ticket sales
*
*******************************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int unitPriceA; //INPUT - The unit price of class A seats.
int unitPriceB; //INPUT - The unit price of class B seats.
int unitPriceC; //INPUT - The unit price of class C seats.
int numb1; //INPUT - The amount of solded class A seats
int numb2; //INPUT - The amount of solded class B seats
int numb3; //INPUT - The amount of solded class C seats
double total; //OUTPUT - The amount of income generated from ticket sales
//
//Initialize Program Variables
unitPriceA = 15;
unitPriceB = 12;
unitPriceC = 9;
cout << " how many tickets for class A of seats were sold? " << endl;
cin >> numb1;
cout << " how many tickets for class B of seats were sold? " << endl;
cin >> numb2;
cout << " how many tickets for class C of seats were sold? " << endl;
cin >> numb3;
//
//Compute The Total Income
total= unitPriceA* numb1+ unitPriceB* numb2+ unitPriceC * numb3;
//
//Output Result
cout<< fixed<< setprecision(2)<< showpoint<< "The income generated from ticket sales is: $"<< total<< endl;
return 0;
}