Question: Computer Science help Write an abstract super class encapsulating a vacation: A vacation has one attribute; a destination. It has an overloaded constructor a toString0

 Computer Science help Write an abstract super class encapsulating a vacation:

Computer Science help

Write an abstract super class encapsulating a vacation: A vacation has one attribute; a destination. It has an overloaded constructor a toString0 and an abstract calculate cost method that returms the total cost of each vacation. This class has two non-abstract subclasses: one encapsulating an all-inclusive vacation, and the other encapsulating a vacation bought piece-meal An all-inclusive vacation has three additional attributes: a brand (for instance ClubMed), a rating, expressed as a number of stars; and a price. In addition an all-inclusive vacation has an overloaded constructor, a toString) and a concrete calculate cost method that retums the total cost of the all-inclusive vacation vacation ( price) A piecemeal vacation has three additional attributes: hotel, meal, airfare as corresponding costs. In addition an all-inclusive vacation has an overloaded constructor, a toString) and a concrete calculate cost method that returns the total cost of the all-inclusive vacation ( sum of hotel, meal and airfare) You also need to include a client class to test these two classes using either an ArrayList or an arrav of obiects to populate the array. Print the state of each element and the total costs for each vacation element

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!