Question
1. Create an Event class that will be the parent class of other classes such as Competition, Party, Conference, Concert (you don't have to write
1. Create an Event class that will be the parent class of other classes such as Competition, Party, Conference, Concert (you don't have to write the other 3 child classes, so you can relax). Event, being the parent, should contain the code common to all types of events. Event should also have one default and one multi-param constructor.
2. Adjust the Concert class so that it inherits from the Event class. (6 marks) The total cost of a concert is the total number of tickets available times the ticket price, and then add 10% for a handling fee (e.g. if there are 1000 tickets at $5 each, total cost is $5500).
3. Create the Charitable interface: this interface should act as a template for a donation() method that returns a donation amount.
• Your Concert class should implement this interface. The donation amount for a charitable concert is 50% of the total cost of the concert.
4. Add the equals() method to your concert class: one concert is equal to another if the ticket prices are the same.
5. Implement Comparable on your Concert class. Compare concert objects by comparing their ticket prices.
A company that manages events needs some help revising their current registration system. There are many different kinds of events: Competitions are events with a team of players that compete in some kind of sport or athletic event.
• Competitions have a cost depending on the number of players or teams participating, plus an equipment cost.
• Parties are events that celebrate some kind of special day or event. Parties have a maximum number of attendees, plus a cost for the event, and a clean- up deposit Conferences are events that consist of various sessions, guest speakers, etc.
• Conferences have a fee, and sometimes require that participants get accommodations like a hotel room. Concerts are music events with one or more performers.
• Concerts have a certain number of tickets available, and tickets all have the same price.
Additionally: . Some events are charitable events, where 50% of the proceeds go to a specific charity Additionally: Some events are charitable events, where 50% of the proceeds go to a specific charity. Some events are put on by a corporation, where there is an extra $300 charge on top of the total costs, for advertising. It's important to note that: All events (competitions, parties, conferences, and concerts) have an event title, event date, and number of days duration.
All events (competitions, parties, conferences, and concerts) should have a cost() method that always calculates the total cost of the event. How this is calculated depends on the type of event, but all event classes (even classes we might add in the future) must have this method. The company had hired a programmer, but that person didn't go to college so they are lacking some of the skills that you have already learned. They've completed one class already, but it needs to be refactored, which is your current task.
Step by Step Solution
3.58 Rating (158 Votes )
There are 3 Steps involved in it
Step: 1
Event Class The Event class should contain code common to all types of events such as the event title event date number of days duration and the cost method The default constructor should set all the ...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