-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathItemToPurchase.cpp
More file actions
60 lines (47 loc) · 1.2 KB
/
Copy pathItemToPurchase.cpp
File metadata and controls
60 lines (47 loc) · 1.2 KB
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
#include <iostream>
using namespace std;
#include "ItemToPurchase.h"
ItemToPurchase::ItemToPurchase() {
itemName = "none";
itemDescription = "none";
itemPrice = 0;
itemQuantity = 0;
}
ItemToPurchase::ItemToPurchase(string name, string description,
int price, int quantity) {
itemName = name;
itemDescription = description;
itemPrice = price;
itemQuantity = quantity;
}
void ItemToPurchase::SetName(string name) {
itemName = name;
}
void ItemToPurchase::SetDescription(string description) {
itemDescription = description;
}
void ItemToPurchase::SetPrice(int price) {
itemPrice = price;
}
void ItemToPurchase::SetQuantity(int quantity) {
itemQuantity = quantity;
}
string ItemToPurchase::GetName() const {
return itemName;
}
string ItemToPurchase::GetDescription() const {
return itemDescription;
}
int ItemToPurchase::GetPrice() const {
return itemPrice;
}
int ItemToPurchase::GetQuantity() const {
return itemQuantity;
}
void ItemToPurchase::PrintItemCost() {
cout << itemName << " " << itemQuantity << " @ $" << itemPrice
<< " = $" << itemPrice * itemQuantity << endl;
}
void ItemToPurchase::PrintItemDescription() {
cout << itemName << ": " << itemDescription << endl;
}