-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBorrow.cpp
82 lines (80 loc) · 2.7 KB
/
Borrow.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// ------------------------------------------------ Borrow.cpp -------------------------------------------------------
// Jasdeep Brar, Cameron Ufland CSS343 C
// Creation Date: March 1, 2020
// Date of Last Modification: March 14, 2020
// --------------------------------------------------------------------------------------------------------------------
// This is the implementation file for the borrow class. This is a subclass of transaction
// --------------------------------------------------------------------------------------------------------------------
//The requirements for this assignment were specified by Wooyoung Kim via class
// and canvas.
// --------------------------------------------------------------------------------------------------------------------
#include "Borrow.h"
//constructors
Borrow::Borrow()
{
this->type = 0;
this->title = "";
this->director = "";
this->majorActorFirstName = "";
this->majorActorLastName = "";
this->releaseMonth = 0;
this->releaseYear = 0;
this->customerID = 0;
}
//Classic
Borrow::Borrow(const int customerID, const char type, const string title, const int releaseMonth, const int releaseYear, const string majorActorFirstName, const string majorActorLastName)
{
this->type = type;
this->title = title;
this->director = "";
this->majorActorFirstName = majorActorFirstName;
this->majorActorLastName = majorActorLastName;
this->releaseMonth = releaseMonth;
this->releaseYear = releaseYear;
this->customerID = customerID;
}
//Funny
Borrow::Borrow(const int customerID, char type, const string title, int releaseYear)
{
this->type = type;
this->title = title;
this->director = "";
this->majorActorFirstName = "";
this->majorActorLastName = "";
this->releaseMonth = 0;
this->releaseYear = releaseYear;
this->customerID = customerID;
}
//Drama
Borrow::Borrow(const int customerID, char type, const string director, string title)
{
this->type = type;
this->title = title;
this->director = director;
this->majorActorFirstName = "";
this->majorActorLastName = "";
this->releaseMonth = 0;
this->releaseYear = 0;
this->customerID = customerID;
}
//end constructors
// -------------------------------- display --------------------------------
// Description
// display: prints out the transaction
// preconditions: none
// postconditions: none
// -----------------------------------------------------------------------------
void Borrow::display()
{
if (type == 'C')
{
cout << "\nCustomer: " << customerID
<< "\n" << "Borrowed: " << title << " " << releaseMonth<< " " << releaseYear<< " " << majorActorFirstName << " " << majorActorLastName << "\n\n";
}
else
{
cout << "\nCustomer: " << customerID
<< "\n" << "Borrowed: " << title << "\n\n";
}
}
//end display