Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

13. (20 points) The abstract class Vacation below defines vacation in terms of its destination (a String) and its budget an integer). Write the definition

image text in transcribed
13. (20 points) The abstract class Vacation below defines vacation in terms of its destination (a String) and its budget an integer). Write the definition of a child class of class Vacation named AllInclusiveVacation. The All InclusiveVacation defines the following members: - an attribute, cost, an integer representing the total cost of vacation - a non-default constructor for the class that initializes all attributes. - a getter/setter for all atributes a method better DealThan() that compares two All InclusiveVacation objects and returns true if the current vacation has the lowest over budget value and returns false, otherwise. HINT: Remember to define/redefine any other methods needed in the child class. public abstract class Vacation! protected String destination; protected int budget; public Vacation (String name, int budget) { this.destination name: this.budget=budget; public String get Destination () { return destination: ) public int get Budget() { return budget; } public void set Destination (String name) { destination name; } public void set Budget (int budget) {this.budget-budget;) public abstract int overBudget(); //returns by how much vacation is over budget (could be negative) public String toString() //returns the details of the current vacation return "unknown vacation details

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Statistical And Scientific Database Management International Working Conference Ssdbm Rome Italy June 21 23 1988 Proceedings Lncs 339

Authors: Maurizio Rafanelli ,John C. Klensin ,Per Svensson

1st Edition

354050575X, 978-3540505754

More Books

Students also viewed these Databases questions