This repository has been archived by the owner on Jan 25, 2023. It is now read-only.
forked from cop3330f19/b2b-shopping-cart-cop-3330-group-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProduct.cpp
103 lines (79 loc) · 1.96 KB
/
Product.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
Group 2 B2B
Product Class implementation
Group members:
Zahir Cooper
Eric Lampley
Amani Muller
Claressa Wilson
Date last edit: 2/10/2020
*/
#include <iomanip>
#include <iostream>
#include <cmath>
#include "Product.h"
#include "Customer.h"
#include "Address.h"
using namespace std;
// Product constructor which takes 4 arguments
Product:: Product(int itemNum, string item_description ,double item_price ,int item_quantity , int amount):
itemNo(itemNum), description(item_description), price(item_price) , stockQuantity(item_quantity), amountPurchased(amount)
{
}
// Default Constructor
Product:: Product()
{
}
// Sets item number
void Product:: setItemNo(int itemNum)
{
itemNo = itemNum;
}
// Returns item number
int Product:: getItemNo()
{
return itemNo;
}
// Sets item description
void Product:: setDescription(string item_description)
{
description = item_description;
}
// Returns item description
string Product:: getDescription()
{
return description;
}
// Sets item price
void Product::setPrice(double item_price)
{
price = item_price;
}
// Returns item price
double Product:: getPrice()
{
return price;
}
// Sets item Stock Quantity
void Product:: setStockQuantity(int item_quantity)
{
stockQuantity = item_quantity;
}
// Returns item Stock Quantity
int Product:: getStockQuantity()
{
return stockQuantity;
}
void const Product:: print()
{
cout << itemNo << setw(22) << description << setw(7) << amountPurchased << setw(10) << setprecision(2)
<< showpoint << fixed << price * amountPurchased << endl << endl;
}
void Product:: setPurchaseAmount(int amount)
{
amountPurchased = amount;
}
int Product:: getPurchaseAmount()
{
return amountPurchased;
}