Question: Java Program Please help me with this. It should be pretty basic and easy but I am struggling with it. Thank you Create a superclass

Java Program Please help me with this. It should be pretty basic and easy but I am struggling with it. Thank you

Create a superclass called VacationInstance Variables

destination - String

budget - double

Constructors - default and parameterized to set all instance variables

Access and mutator methods

budgetBalance method - returns the amount the vacation is under or over budget. Under budget is a positive number and over budget is a negative number. This method will be overwritten in the subclass so have it return Java's integer minimum value.

Create a concrete class called AllInclusive that represents an all inclusive vacation like Sandals or Club Med.Instance Variables

brand - String, such as Sandels , 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.

Create a concrete class called ALaCarte - a pay 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 of both classes, however test methods in the superclass Vacation from either subclass object (AllInclusive or ALaCarte)

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

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!