Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 5E: Create an application named CarDemo that declares at least two Car objects and demonstrates how they...
icon
Related questions
Question

Please do not copy and paste the answer that Chegg has for this question. I have asked this question already and the expert copied and pasted the answer from Chegg. Please actually solve this problem, or I'll just have to cancel my Bartleby subscription.

C++ Question 

Hello, Please create the correct code based on the attached requirement pictures. Please make sure the code is functional and also do not use any Advanced Syntax. Thank you.

 

In your program's Source.cpp, create a vector that holds Event objects (Hint: Recall from lecture 18, we discussed
adding objects to an array. You can also add objects to a vector in a similar way). In main, the user has the following
choices:
• Add an event to the vector. Ask the user for the date info (day, month, year) start and end time (the user should
enter values between O and 23) and the name of the event: If there is already an event in the vector on the given
date and its time overlaps the event the user is trying to add, print out the info about that event and do not add the
new event.
• Cancel an event: The user will type in the name of the event to cancel. Remove the event from the vector (if it
exists).
View all events: In a loop, print the info of all the events currently planned.
Quit
Transcribed Image Text:In your program's Source.cpp, create a vector that holds Event objects (Hint: Recall from lecture 18, we discussed adding objects to an array. You can also add objects to a vector in a similar way). In main, the user has the following choices: • Add an event to the vector. Ask the user for the date info (day, month, year) start and end time (the user should enter values between O and 23) and the name of the event: If there is already an event in the vector on the given date and its time overlaps the event the user is trying to add, print out the info about that event and do not add the new event. • Cancel an event: The user will type in the name of the event to cancel. Remove the event from the vector (if it exists). View all events: In a loop, print the info of all the events currently planned. Quit
You will be writing a scheduling application allowing a convention center to schedule events at their location. This
program will contain two different classes: Date and Event. Both classes should have .h and .cpp files: You will have five
files in total.
The Date class should have the following:
Member variables:
• int day;
• int month;
• int year;
Member functions:
• setDate: Takes three arguments: the day, month, and year. Sets the day, month, and year members of the object. Do
not allow values to be negative, day to be greater than 31, and month to be greater than 12.
• printDate: Uses cout to print the data in the format "dd/mm/yyyy". You need to include iostream to your Date.cpp
file to do this.
• Getters for the members.
Event should have the following:
Member variables:
• Date *eventDate; Note: Make sure your Event class has a pointer to a Date and not a Date object on the stack.
• tring eventName:
• int startHour: Uses a 24-hour clock, so should be a value between 0 and 23
• int endHour: Uses a 24-hour clock, so should be a value between 0 and 23
Member functions:
• printEvent. Use cout to print all info about this event. The name of the event, the start and end times (you can
simply print their value i.e. from 14 to 16) and the Date.
• Setters and Getters for the member variables.
• A constructor which takes a string for the name, ints for the start and end hours, and a pointer to a Date object.
Make sure the end hour is larger than the start hour.
• A destructor which deletes the object eventDate points to.
Note: For sake of simplicity, each event will only take one day. Each event will also not go over midnight, so startHour
must be less than endHour. For example, an event that starts at 2pm and ends at 4pm would have a startHour of 14 and
an endHour of 16.
Transcribed Image Text:You will be writing a scheduling application allowing a convention center to schedule events at their location. This program will contain two different classes: Date and Event. Both classes should have .h and .cpp files: You will have five files in total. The Date class should have the following: Member variables: • int day; • int month; • int year; Member functions: • setDate: Takes three arguments: the day, month, and year. Sets the day, month, and year members of the object. Do not allow values to be negative, day to be greater than 31, and month to be greater than 12. • printDate: Uses cout to print the data in the format "dd/mm/yyyy". You need to include iostream to your Date.cpp file to do this. • Getters for the members. Event should have the following: Member variables: • Date *eventDate; Note: Make sure your Event class has a pointer to a Date and not a Date object on the stack. • tring eventName: • int startHour: Uses a 24-hour clock, so should be a value between 0 and 23 • int endHour: Uses a 24-hour clock, so should be a value between 0 and 23 Member functions: • printEvent. Use cout to print all info about this event. The name of the event, the start and end times (you can simply print their value i.e. from 14 to 16) and the Date. • Setters and Getters for the member variables. • A constructor which takes a string for the name, ints for the start and end hours, and a pointer to a Date object. Make sure the end hour is larger than the start hour. • A destructor which deletes the object eventDate points to. Note: For sake of simplicity, each event will only take one day. Each event will also not go over midnight, so startHour must be less than endHour. For example, an event that starts at 2pm and ends at 4pm would have a startHour of 14 and an endHour of 16.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Excel Sheet
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT