-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMovie.cpp
33 lines (27 loc) · 1.02 KB
/
Movie.cpp
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
/******************************************************************
* Movie.cpp
*
* Models a Movie with the following atttributes
*
* std::string name - the name of the movie
* std::string rating - G, PG, PG-13, R
* int watched - the number of times you've watched the movie
* ***************************************************************/
#include <iostream>
#include "Movie.h"
// Implemention of the construcor-using the initialization list concept
Movie::Movie(std::string name, std::string rating, int watched)
: name(name), rating(rating), watched(watched) {
}
//Implemention of the copy constructor-by delagating constructor
Movie::Movie(const Movie &source)
: Movie{source.name, source.rating, source.watched} {
}
// Implementation of the destructor
Movie::~Movie() {
}
// Implementation of the display method
// should just insert the movie attributes to cout
void Movie::display() const {
std::cout << name << ", " << rating << ", " << watched << std::endl;
}