At 8:00 PM, your little brother/sister starts to watch a movie using a DVD player. The length of a movie varies
from 80 to 150 minutes. At 9:30 PM, you want to check the DVD is on or off.
1. Construct a DVDPlayer class with two attributes : status (on or off) and movie length.
2. Create a constructor that is used to initialize the DVD player
3. Create the regular getters and setters
4. Create a checkStatus member function, with the number of minutes since 8:00 PM as the input (i.e. 100
means the time is 9:40 PM). Set the status as off if this value is larger than the length of the movie
played on this DVD.
5. In your main function, create a DVD object and initialize with the constructor (arguments: status-on,
movie time length – use the input from the keyboard). Then check this DVD’s status after 90 minutes
(i.e. at 9:30 PM), report the status of this DVD by printing it out.
int Dvd::getLength()const
{
return movieLength;
}
Dvd::Dvd(int x)
{
movieLength = x;
status = true;
if (x<80 || x>150)
{
cout << "This movie will cause the Dvd player to turn off before it finishes. " << endl;
exit(1);
}