Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write a C# code Write an abstract class called Vacation that includes three class variables named: cost, budget and destination. It has an abstract

Please write a C# code

Write an abstract class called Vacation that includes three class variables named: cost, budget and destination. It has an abstract method, KeptToBudget, returning how much the vacation is over or under budget using cost. This class has two non-abstract subclasses, each with their own class variables: All-Inclusive Vacation: o brand (such as ClubMed, Delta Vacations, etc.) o rating (number of stars) o total cost (all-inclusive means that there is one price for all expenses on the trip). Piecemeal Vacation: o list of expenses (hotel, meal, airfare, etc.). o list of corresponding costs (hotel cost, meal cost, airfare cost, etc.). (Both of these class variables must be an array, or similar data structure.) Lastly, create a test class that will create 2 All-Inclusive Vacation and 2 Piecemeal Vacation object inside of a main method. Also create 2 Vacation objects that are set to 1 All-Inclusive Vacation and 1 Piecemeal Vacation object. You may have user input for their object variables or you may hardcode the values. Ensure that you print each objects values to the console along with the return value of the KeptToBudget method.

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

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

0764549634, 9780764549632

More Books

Students also viewed these Databases questions