-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTransaction.cpp
88 lines (80 loc) · 2.75 KB
/
Transaction.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
83
84
85
86
87
88
// ------------------------------------------------ Transaction.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 Transaction class that will act as the base class for Borrow and Return
// --------------------------------------------------------------------------------------------------------------------
//The requirements for this assignment were specified by Wooyoung Kim via class
// and canvas.
// --------------------------------------------------------------------------------------------------------------------
#include "Transaction.h"
//Default Constructor
Transaction::Transaction()
{
this->type = 0;
this->title = "";
this->director = "";
this->majorActorFirstName = "";
this->majorActorLastName = "";
this->releaseMonth = 0;
this->releaseYear = 0;
this->customerID = 0;
}
// -------------------------------- operator << --------------------------------
// Description
// operator <<: prints out the transaction
// preconditions: none
// postconditions: none
// -----------------------------------------------------------------------------
ostream& operator <<(ostream& output, Transaction& t)
{
return output;
}
// end of oprerator <<
// Destructor
Transaction::~Transaction()
{
}
// -------------------------------- getCustomerID() --------------------------------
// Description
// getCustomerID: gets the objects customer ID
// preconditions: none
// postconditions: none
// -----------------------------------------------------------------------------
int Transaction::getCustomerID() const
{
return this->customerID;
}
// end of getCustomerID()
// -------------------------------- display --------------------------------
// Description
// display: prints out the transaction
// preconditions: none
// postconditions: none
// -----------------------------------------------------------------------------
void Transaction::display()
{
if (type == 'C')
{
cout << "Customer: " << customerID
<< "\n" << "Borrowed: " << releaseMonth << " " << releaseYear << " " << majorActorFirstName << " " << majorActorLastName << endl;
}
else
{
cout << "Customer: " << customerID
<< "\n" << "Borrowed: " << title << endl;
}
}
// end of display()
// -------------------------------- getType() --------------------------------
// Description
// getType: gets the objects movie type
// preconditions: none
// postconditions: none
// -----------------------------------------------------------------------------
char Transaction::getType() const
{
return this->type;
}
// end of getType()