Question
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
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