Question: Write an abstract superclass encapsulating or for a Vacation: A vacation has two attributes, budget and destination. It has an abstract method returning how much

Write an abstract superclass encapsulating or for a Vacation: A vacation has two attributes, budget and destination. It has an abstract method returning how much the vacation is over budget. Create two non-abstract classes that extend vacation: one for an all-inclusive vacation, and another for a piecemeal vacation. All inclusive will have three attributes: brand, rating (represented by number of stars), and a price. Piecemeal needs to have a list of items (hotel, meals, airfaire, etc.) and their corresponding costs. This can be handled using parallel arrays, thus there will only be two attributes. Be sure to write appropriate getters, setters, and constructors for all 3 classes. Don't forget the abstract method. HINT: It is ok to have a constructor for an abstract class. It can be called to set up attribute values from the child class. Write a test application for these classes. You can create this as an application for a user to determine which vacation option is right for them. Create a piecemeal and all inclusive vacation object. Be sure to appropriately ask for and load the field values. Display all information for each object and display whether the vacation is over budget (showing by how much), under budget (showing how much), or right at budget.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!