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

(C++) For this project, you will create a program that calculates the number of

ID: 3860110 • Letter: #

Question

(C++) For this project, you will create a program that calculates the number of possible individual-sale tickets for a Cubs baseball game at Wrigley field that has a maximum seating capacity of 41,159. The program is intended for Wrigley Field ticketing agents. The agent should be prompted for the number of season ticket holders and for the number of reserved corporate ticket holders. The program should add together these two numbers and subtract them from the seating capacity, then display the total as the number of available tickets for individual sales. Minimum Requirements: STYLE (important for Java Programmers): Implement all functions separately (no inline implementations). The main function should create an object of the tickets class and call each of the functions of the tickets class. 5 points Create a class called tickets to calculate available tickets. This class must include the following functions 5 points : Create a function for the ticket class that will perform the calculation described above. For an extra challenge, create more than one function for this: one function to take in the numbers and another to do the calculation. 5 points Create a function to display the results of the calculation by displaying the contents of a private class variable that holds the calculation results. Note that displaying the results cannot be in the same function that performs the calculation. They must be in separate functions. 5 points Upload your .cpp and .h files here If you have questions or concerns, do not include them in your submission or you will have to wait for the project to be graded. Getting help requires a two-way conversation and this submission page doesn't allow that. Instead, if you need help, start a conversation and get help right away! Post to the discussion board, or contact me directly via email

Explanation / Answer

Answer

#include <iostream>
using namespace std;
class tickets
{
//Private Data Members
int seating_capacity;
int season_ticket_holders;
int reserved_corporate_ticket_holders;
int individual_sale_tickets;
public:
tickets() //class constructor
{
seating_capacity =41159;
}
void input() //Input Function
{
cout<<" Enter number of Season ticket holders : ";
cin>>season_ticket_holders;
cout<<" Enter number of Reserved corporate ticket holders : ";
cin>>reserved_corporate_ticket_holders;
}
void calculate() //calculation function
{
individual_sale_tickets=seating_capacity-(season_ticket_holders+reserved_corporate_ticket_holders);
}
void display() /display function
{
cout<<" ---------------------GROUND SEATING ANALYSIS--------------------";
cout<<" Seating Capacity : "<<seating_capacity;
cout<<" Season ticket holders : "<<season_ticket_holders;
cout<<" Reserved corporate ticket holders : "<<reserved_corporate_ticket_holders;
cout<<" Possible individual sale tickets : "<<individual_sale_tickets;
}
};
int main()
{
tickets obj; //class object creation
cout<<" -------------------------Welcome to The Wrigley Field for Cubs Baseball Game-------------------------- ";
obj.input(); //member function call
obj.calculate();
obj.display();
return 0;
}