Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Activity 1: Review Chapter 8 and All Inheritance examples. Build an application that handles setting up vacation plans. Create an abstract superclass called Vacation Instance
Activity 1:
- Review Chapter 8 and All Inheritance examples.
- Build an application that handles setting up vacation plans.
- Create an abstract superclass called Vacation
- Instance Variables
- destination - String
- budget - double
- Constructors - default and parameterized to set all instance variables
- Access and mutator methods
- budgetBalance method - abstract method that returns the amount the vacation is under or over budget. Under budget is a positive number and over budget is a negative number.
- Instance Variables
- Create a concrete class called AllInclusive that is a subclass of Vacation and represents an all inclusive vacation like Sandals or Club Med.
- Instance Variables
- brand - String, such as Sandals , Club Med etc
- rating - int, representing number of stars such as 5 star rating.
- price - double, the total cost of the vacation
- Constructor - default and parameterized to set all instance variables
- Accessor and mutator methods
- Overwritten budgetBalance method.
- Instance Variables
- Create a concrete class called ALaCarte that is a subclass of Vacation and represents a vacation that requires payment for each activity separately
- Instance Variables
-
- hotelName - String
- roomCost - double
- airline - String
- airfare - double
- meals - double - estimated total meal expenses.
- Constructor - default and parameterized to set all instance variables
- Accessor and mutator methods
- Overwritten budgetBalance method.
- Create a VacationTester class
- Test all methods.
- Polymorphically call the budgetBalance method by creating at least 2 object of each Vacation subclass, and place those object in a collection of the Vacation object.
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