-
Notifications
You must be signed in to change notification settings - Fork 0
/
ItemToPurchase.cpp
68 lines (54 loc) · 1.77 KB
/
ItemToPurchase.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
/*
Alexis Reeves, Section 02, [email protected]
Description: Runs ItemToPurchase class. Includes a constructor with default parameters. Includes Get/Set name, price,
quanity, and description functions. Includes print cost function ad print description function.
Done without pair programming and in Visual Studio.
Late Days: none
*/
#include "ItemToPurchase.h"
#include <iostream>
using namespace std;
ItemToPurchase::ItemToPurchase() {
itemName = "none";
itemPrice = 0.0;
itemQuantity = 0;
itemDescription = "none";
return;
}
ItemToPurchase::ItemToPurchase(string itemName = "none", string itemDescription = "none",
double itemPrice = 0.0, int itemQuantity = 0) {
this->itemName = itemName;
this->itemDescription = itemDescription;
this->itemPrice = itemPrice;
this->itemQuantity = itemQuantity;
}
string ItemToPurchase::GetName() const {
return this->itemName;
}
void ItemToPurchase::SetName(string itemName) {
this->itemName = itemName;
}
double ItemToPurchase::GetPrice() const {
return this->itemPrice;
}
void ItemToPurchase::SetPrice(double itemPrice) {
this->itemPrice = itemPrice;
}
int ItemToPurchase::GetQuantity() const {
return this->itemQuantity;
}
void ItemToPurchase::SetQuantity(int itemQuantity) {
this->itemQuantity = itemQuantity;
}
void ItemToPurchase::SetDescription(string itemDescription) {
this->itemDescription = itemDescription;
}
string ItemToPurchase::GetDescription() const {
return this->itemDescription;
}
void ItemToPurchase::PrintCostItem() const {
cout << itemName << " " << itemQuantity << " @ $" << itemPrice << " = $" << itemQuantity * itemPrice << endl;
}
void ItemToPurchase::PrintDescriptionItem() const {
cout << itemName << ": " << itemDescription << endl;
}