Question
Write a Java program for this scenario (one Data Definition Class and one Implementation Class) The football team at Clatterbuck High School has hired you
Write a Java program for this scenario (one Data Definition Class and one Implementation Class)
The football team at Clatterbuck High School has hired you to develop an application that tracks ticket sales at home football games. The application should allow a user to first enter the name of the event (e.g., Home football game vs. Winnebago High School). Next, the application should ask how many tickets are available for purchase. The stadium at Clatterbuck holds a maximum of 5,000 spectators, but sometimes less seats are sold (for example, if the marching band is at the game, they might only sell 4,800 tickets). Finally, some home football games at Clatterbuck are sponsored by local businesses, who donate $1 to the school for every paid ticket sold. The application should ask whether the event is sponsored or not.
As groups arrive at the ticket counter, the application should prompt the user to enter the number of tickets sold. The application will have no way of knowing in advance how many groups might arrive at the ticket counter. There are 3 different types of tickets- an adult ticket for $7.00, a child ticket for $4.00, and a free ticket for families of players.
Your object-oriented application must use a data definition class to model one football game with an implementation class to gather ticket sales information for the game. The data definition class should track the event name, maximum number of tickets allowed to be sold, whether the game is sponsored, and the number of tickets (adult, child, and free) sold. Accessors and mutators must be created for all instance variables.
With a completed data definition class, your implementation class must instantiate one object from the data definition class. Your object-oriented application will gather the event name, the maximum number of tickets allowed to be sold (if available), and whether or not the event is sponsored. Then, the application should continuously prompt the user for the number and type of tickets ordered per group, until the user has indicated they are finished. Once all data is entered, the application should print a well-formatted report containing the event name, maximum seating capacity, if the event was sponsored or not. It should also display the total number of adult, child, and free tickets sold, the total revenue from sales, and any sponsor donations if applicable.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started