QUESTION in C++
C++ C++ C++
The following diagram illustrates the classes you will implement in this lab and their relationships. Meeting Time Meeting (-) hour: int (1-24, inclusive) (-) minute: int (0-59, inclusive) (#) meetingTime : MeetingTime (-) Host: string (-) Topic: string (+) default constructor (+) Parameterized Constructor (+) parameterized constructor (+) setters (+) Setters (+) getters (+) Getters (+) print Details : void Lecture (-) attendees: int > 0 (-) duration : int > 0 (+) default constructor (+) Parameterized Constructor (+) Getters (+) Setters (+) print Details: void (+) advance_lecture_time(): void NOTE 1: In all of your code, do not forget to validate all user input. Also, remember to make all functions that do not modify the class attributes constant. NOTE 2: Do not put all of your code in one file; separate implementation from the interface. For this assignment you need to submit a header and an implementation file for the 3 classes (6 files) and one main program file. The total is 7 files. NOTE 3: Avoid duplication of code! If something is already done in the base class, do not do it again in the derived class.
QUESTION 1: (20 points) Implement Class MeetingTime as described in the UML diagram above. QUESTION 2: (30 points) Implement Class Meeting as described in the UML diagram above. Notice that, meetingTime is protected and not private in this class. QUESTION 3: (40 points) Implement class Lecture, which inherits from class Meeting. Note the following: - The duration data member represents the amount of time a Lecture will last, measured in minutes The attendees data member represents the number of people who can attend the lecture. Function printDetails of the base class should be overridden to print the additional information about the duration and attendees. advance_lecture_time in class this class advances the meeting hour in this object by 1 QUESTION 4 (20 points): Implement a driver program to test your code. - Create an object of type Lecture, call it lecture1 using the parameterized constructor. - print lecture1 details. - Create an object of type Meeting call it meeting2, using the parameterized constructor -print meeting2 details. - advance the hour of lecture1 using one C++ statement. - if you use private or protected inheritance, would you be still able to implement advance_lecture_time in Lecture class? Why or why not? Answer this part as a comment in your main.
Sample Output --Lecture Information-- The number of people who can attend the lecture are: 20 The amount of time of the Lecture: 2 Topic: Artificial Intelligence Host: D Meeting Time: 5:30 --Meeting Information- Topic: Machine Learning Host: M Meeting Time: 2:20 After the advance of the time of the lecture: --Lecture Information-- The number of people who can attend the lecture are: 20 The amount of time of the Lecture: 2 Topic: Artificial Intelligence Host: D Meeting Time: 6:30
write a new code this is a new The following diagram illustrates the classes you will implement in this lab and their relationships. Meeting Time Meeti
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am