Question: c++ code only 9.4 Create a PrgDevice class that can be used as an abstract base class to derive classes that represent different types of

9.4 Create a PrgDevice class that can be used as an abstract base class to derive classes that represent different types of programmable devices. PrgDevi ce should contain general properties, data members and functions, that are common to all kinds of programmable devices (e.g., start date and time, stop date and time, and functions to get these values from the user and to calculate the difference between the start/stop time and the current system time). Create three classes that represent three different kinds of programmable household devices, such as a VCR, DVR, and alarm system. These classes should be derived from the PrgDevice class. Design the main() function that instantiates objects of all three classes that represent programmable devices. The program should allow the user choose a device(s), set a start and stop date and time, as well as to select a task to be executed. The program should also display the status of all programmable devices at any given time as requested by the user. A sample run of this program is shown in Figure 9.19. Main menu options: 1. Select a device to program 2. Display the current status of all devices 3. Exit Enter your option 1 Select a device: 1. VCR 2. DVR 3. Alarm Enter your choice 1 Select the channel 30 Enter the start date and time of recording 01:08:1220:00:00 Enter the stop date and time of recording 01:08:1222:30:00 Another device to program Y/N ? N Main menu options: 1. Select a device to program 2. Display the current status of all devices 3. Exit Enter your option 2 Date: 01:08:2012 Time: 21:34:30 VCR recording 1:34:30 hours - channel 30 Alarm SET ON 2:25:65 hours DVR finished recording - channel 22 Figure 9.19 Sample run of Programming Project 9.4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
