Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Summer C + + Create a class called Date that contains private data for month, day, and year as integers. Include a non - default
Summer C
Create a class called Date that contains private data for month, day, and year as integers. Include a non default constructor ONLY that requires all the data. Include a displayDate function that returns the date as a string in mmddyyyy format.
Create a class called Hotel that contains private data for the name of the hotel and the cost per night. Include BOTH a default constructor and a nondefault constructor. Include a displayHotel function that returns a string in the following format: $ per night Hilton Garden Inn Include an accessor function for the cost per night.
Create a class called Attraction that contains private data for name and ticket cost. Include a nondefault constructor ONLY that requires all the data. Include a displayAttraction function that displays the following $ Zoo and does NOT return a value. Include an accessor function for the ticket cost.
Create a class called Trip that contains a starting Date object and ending Date object the destination name, the chosen Hotel object a vector of chosen Attractions objects the total cost of the trip and the number of people going on the trip. Include a nondefault constructor that requires the destination name, the number of people, and the data required for the starting and ending Dates. Include a mutator function for the Hotel. Include an addAttraction function that will accept an Attraction as a parameter and will add the Attraction to the vector of chosen Attractions. Include a calculateCost function that will calculate the total cost for the trip as follows: Assume that the trip will be for nights and use a range based for loop that will get the cost of each chosen Attraction and calculate the cost for all of the people on the trip. This amount will be added to the total cost of the trip. Lastly, include a displayTrip function that will print all of the trip information including the destination, the number of people, the date leaving, the date returning, the hotel information, the attraction information and the total cost of the trip. Display in the following format:
Your trip to Houghton for people:
Date Leaving
Date Returning
Staying at $ per night Quality Inn and Suites
Selected Attractions
$ River Boat
$ Historical Museum
Total cost of trip: $
This is the end of the code for the classes!
Your main function will ONLY do the following:
Call the selectDestination function
Ask the user for the date of arrival to their destination mm dd yyyyHint: You can take in more than one value on a cin eg cinvavar
Enter date of arrival to Houghton: MM DD YYYY
Ask the user for the date of departure from their destination mm dd yyyy
Enter date of departure from Houghton: MM DD YYYY
Ask the user how many people are going on the trip.
How many people are going on the trip?
Using the data from the user, create a Trip object.
Call the selectHotel function
Use your trip object to set the selected hotel
Call the selectAttractions function, sending your Trip object as an argument
Use your Trip object to call the calculateCost function
Use your Trip object to call the displayTrip function
selectDestination Function:
This function will contain this initialized vector of strings:
std::vector destinationCities Mackinaw Island", "Holland", "Traverse City", "Houghton";
The function will use the vector and a loop to ask the user to choose a city and return the chosen city. see below You do NOT have to validate!
Please choose a city:
Mackinaw Island
Holland
Traverse City
Houghton
selectHotel Function:
This function will contain an array of hotels using this initialization:
Hotel allHotels HotelHilton Garden Inn",
HotelQuality Inn and Suites",
HotelHoliday Inn",
HotelMarriott
;
The function will use the array and a loop to ask the user to choose a Hotel and return the chosen Hotel see below You MUST validate this data. The choice can only be and may not be letters!
Choose a hotel:
: $ per night Hilton Garden Inn
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