//Jeremy Huang CS1A Chapter 3, P. 143, #2
//
/**************************************************************
*
* CALCULATE INCOME FROM TICKETS
* ____________________________________________________________
* This program computes total income made from ticket sales
* based on the amount of tickets sold from each class
* and adding them.
* ____________________________________________________________
* INPUT
* class_A_tickets : Number of class A tickets sold
* class_B_tickets : Number of class B tickets sold
* class_C_tickets : Number of class C tickets sold
*
* OUTPUT
* totalIncome : Total income made from ticket sales
*
**************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
// Constants for ticket prices
const double CLASS_A_PRICE = 15.00;
const double CLASS_B_PRICE = 12.00;
const double CLASS_C_PRICE = 9.00;
int class_A_tickets; //INPUT - Number of class A tickets sold
int class_B_tickets; //INPUT - Number of class B tickets sold
int class_C_tickets; //INPUT - Number of class C tickets sold
double totalIncome; //OUTPUT - Total income made from ticket sales
// Prompt user for the number of Class A tickets sold
cout<<"\nEnter the number of Class A tickets sold: ";
cin>>class_A_tickets;
// Prompt user for the number of Class B tickets sold
cout<<"\nEnter the number of Class B tickets sold: ";
cin>>class_B_tickets;
// Prompt user for the number of Class C tickets sold
cout<<"\nEnter the number of Class C tickets sold: ";
cin>>class_C_tickets;
//Calculate total income
totalIncome = (class_A_tickets*CLASS_A_PRICE)+
(class_B_tickets*CLASS_B_PRICE)+
(class_C_tickets*CLASS_C_PRICE);
//Output result
cout<<fixed<<showpoint<<setprecision(2);
cout<<"\nTotal income from the ticket sales: $"<<totalIncome;
return 0;
}