-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInventory.cpp
More file actions
73 lines (60 loc) · 1.49 KB
/
Inventory.cpp
File metadata and controls
73 lines (60 loc) · 1.49 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
61
62
63
64
65
66
67
68
69
70
71
72
73
// Preprocessor directives required for the Inventory.cpp file
#include "Inventory.h"
#include <string>
using namespace std;
// Creates a default constructor for the inventory class that sets the inventory pointer to null
Inventory::Inventory()
{
next = nullptr;
}
Inventory::Inventory(int Number, string Name, double Cost, int quanti)
{
itemNumber = Number;
itemName = Name;
itemCost = Cost;
quantity = quanti;
}
// Declares a deconstructor function for the inventory class
Inventory::~Inventory()
{
}
// Creates a member function used to retrieve the itemNumber
int Inventory::getItemNumber() const
{
return itemNumber;
}
// Creates a member function used to retrieve the itemName
string Inventory::getItemName() const
{
return itemName;
}
// Creates a member function used to retrieve the itemCost
double Inventory::getItemCost() const
{
return itemCost;
}
// Creates a member function used to retrieve the quantity
int Inventory::getQuantity() const
{
return quantity;
}
// Declares a member function used to set the itemNumber
void Inventory::setItemNumber(int number)
{
itemNumber = number;
}
// Declares a member function used to set the itemName
void Inventory::setItemName(string name)
{
itemName = name;
}
// Declares a member function used to set the itemCost
void Inventory::setItemCost(double cost)
{
itemCost = cost;
}
// Declares a member function used to set the quantity
void Inventory::setQuantity(int quantit)
{
quantity = quantit;
}