-
Notifications
You must be signed in to change notification settings - Fork 0
/
Movie.h
50 lines (40 loc) · 933 Bytes
/
Movie.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <string>
#include <iostream>
#pragma once
class Movie
{
private:
std::string name{ "None" };
std::string rating{ "None" };
double watched{ 0 };
public:
//3 args contructor
Movie(std::string moviename, std::string movierating, double timeswatched)
:name{ moviename }, rating{ movierating }, watched{ timeswatched }{}
Movie(std::string moviename, std::string movierating)//2 args contructor
:Movie(moviename, movierating, 0){}
Movie(std::string moviename)//1 args contructor
:Movie{moviename, "None", 0}{}
Movie(){}// No args
Movie(const Movie& source)//Copy contructor
:name{ source.name }, rating{ source.rating }, watched{ source.watched }{}
~Movie(){} // Destructor
//getters
std::string getname()
{
return name;
}
std::string getrating()
{
return rating;
}
double getwatched()
{
return watched;
}
//setters
void incrementwatched()
{
watched += 1;
}
};