Answered step by step
Verified Expert Solution
Link Copied!

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 mm/dd/yyyy 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 non-default constructor. Include a displayHotel() function that returns a string in the following format: $ 164.00(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 non-default constructor ONLY that requires all the data. Include a displayAttraction() function that displays the following $ 16.50 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 non-default 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: (1) Assume that the trip will be for 5 nights and (2) 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 6 people:
Date Leaving 6/1/2023
Date Returning 6/6/2023
Staying at $ 105.00(per night) Quality Inn and Suites
Selected Attractions
$ 152.00 River Boat
$ 10.50 Historical Museum
Total cost of trip: $ 1500.00
-------- 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 yyyy)(Hint: You can take in more than one value on a cin e.g. cin>>va1>>var2)
Enter date of arrival to Houghton: MM DD YYYY 612023
Ask the user for the date of departure from their destination (mm dd yyyy)
Enter date of departure from Houghton: MM DD YYYY 662023
Ask the user how many people are going on the trip.
How many people are going on the trip? 6
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[4]={ Hotel("Hilton Garden Inn",164),
Hotel("Quality Inn and Suites",105),
Hotel("Holiday Inn",139),
Hotel("Marriott",152)
};
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 14 and may not be letters!
Choose a hotel:
1: $ 164.00(per night) Hilton Garden Inn

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

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions