Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

There are three seating categories at a stadium. For a softball game, Class A se

ID: 3589673 • Letter: T

Question

There are three seating categories at a stadium. For a softball game, Class A seats cost $15,Class B seats cost $12, and Class C seats cost $9. Write a program that asks how many tickets for each class of seats were sold, then displays the amount of income generated from ticket sales. Format your dollar amount in a fixed-point notation with two decimalpoints and make sure the decimal point is always displayed. Add Comments * Print Name and Assignment on screen ** Date ** Submit.zip file containing a .cpp file.

Explanation / Answer

#include <iostream>

#include <iomanip>


int main()

{

  
   // initializing classA,classB,classC prices.
    double classA=15.00;
    double classB=12.00;
    double classC=9.00;
    // declaring classes seats.
    int classASeats,classBSeats,classCSeats;
    // initialize income variable.
    double income=0.00;
  

    std::cout << "Enetr How many class A seats Filled : ";
// reading input from user
    std::cin >>classASeats;


std::cout << "Enetr How many class B seats Filled : ";

    std::cin >>classBSeats;

std::cout << "Enetr How many class C seats Filled : ";

    std::cin >>classCSeats;

// calculating income based on class prica and number of seats filled.
income=(classA*classASeats)+(classB*classBSeats)+(classC*classCSeats);

// printing total income in setting 2 precision.
    std::cout << std::fixed << std::setprecision(2) << "Total income of seats sale is $"<<income;

}

/*output:-

*/