Simply looking for some tips to help make this program

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.
what do you mean by tips?
stat with your code. some will help where you stuck.
Dvd.h

#include <iostream>
#include<string>

class Dvd
{
private:
int movieLength;
bool status;

public:
Dvd(int);
int getLength()const;
bool getStatus()const;
void setLength(int);
void setStatus(bool);
void checkStatus(int);

};

Dvd.cpp

#include <iostream>
#include "Dvd.h"

using namespace std;

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);
}

}
bool Dvd::getStatus()const
{
return status;
}
void Dvd::setLength(int x)
{
movieLength = x;
}
void Dvd::setStatus(bool status)
{
this->status = status;
}
void Dvd::checkStatus(int time)
{
if (time > movieLength)
{
status = false;
}
}

Main.cpp

#include"Dvd.h"
#include <iostream>
using namespace std;


int main()

{



Dvd myDvd(94);

myDvd.checkStatus(90);
{
if (myDvd.getStatus == true)
{
cout << "DVD player still on." << endl;
}

}

return 0;
}



I am not sure where to go with the main.cpp file, or if that .cpp is even necessary. Any help would be nice. Thanks
please use code tags <>
for small program like this, its better to write in a single file.
Topic archived. No new replies allowed.