//Devin Scheu CS1A Chapter 3, P. 143, #2
//
/**************************************************************
*
* CALCULATE TICKET SALES INCOME
* ____________________________________________________________
* This program calculates the total income generated from ticket
* sales for three seating categories (Class A, B, and C) based on
* the number of tickets sold for each class.
*
* Computation is based on the formulas:
* classAIncome = classATickets * 15
* classBIncome = classBTickets * 12
* classCIncome = classCTickets * 9
* totalIncome = classAIncome + classBIncome + classCIncome
* ____________________________________________________________
* INPUT
* classATickets : Number of Class A tickets sold (as an integer)
* classBTickets : Number of Class B tickets sold (as an integer)
* classCTickets : Number of Class C tickets sold (as an integer)
*
* PROCESSING
* classAIncome : Income from Class A tickets (in dollars)
* classBIncome : Income from Class B tickets (in dollars)
* classCIncome : Income from Class C tickets (in dollars)
*
* OUTPUT
* totalIncome : Total income from all ticket sales (in dollars)
*
**************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main () {
//Variable Declarations
int classATickets; //INPUT - Number of Class A tickets sold (as an integer)
int classBTickets; //INPUT - Number of Class B tickets sold (as an integer)
int classCTickets; //INPUT - Number of Class C tickets sold (as an integer)
double classAIncome; //PROCESSING - Income from Class A tickets (in dollars)
double classBIncome; //PROCESSING - Income from Class B tickets (in dollars)
double classCIncome; //PROCESSING - Income from Class C tickets (in dollars)
double totalIncome; //OUTPUT - Total income from all ticket sales (in dollars)
//Prompt for Input
cout << "Enter the number of Class A tickets sold: ";
cin >> classATickets;
cout << "\nEnter the number of Class B tickets sold: ";
cin >> classBTickets;
cout << "\nEnter the number of Class C tickets sold: ";
cin >> classCTickets;
//Calculate Income for Each Class
classAIncome = classATickets * 15.00;
classBIncome = classBTickets * 12.00;
classCIncome = classCTickets * 9.00;
//Calculate Total Income
totalIncome = classAIncome + classBIncome + classCIncome;
//Output Result
cout << fixed << setprecision(2) << "\nTotal income from ticket sales is: $" << totalIncome << endl;
} //end of main()