-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStock.h
More file actions
69 lines (48 loc) · 1.93 KB
/
Stock.h
File metadata and controls
69 lines (48 loc) · 1.93 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
#ifndef STOCK_H
#define STOCK_H
#include<iostream>
#include <iomanip>
using namespace std;
class Stock
{
///Function of Type Istream returns an istream value with Menu and conditions to check choice validation.
friend istream& operator>> (istream& in , Stock& item);
public:
///Default Constructor To set the Quantity of items to Quantity Array.
Stock();
///Parameterize Constructor To set choice and userMoney.
Stock(int ch , float um);
///Function to get the input to user Money.
void getuserMoney(float money);
///Function to set the input to choice.
void setChoice(int choice1);
///to check if user money < the price of item he chosen
bool operator< (Stock);
///A Function to get item name.
string getItem();
///A Function to decrement item from Stock
int item_Decrement();
///function to check if chosen item exist or not.
bool checkQuantity();
///Function to get choice.
int getChoice();
///A Function to check if userMoney < Price of chosen Item.
bool checkSufficient();
///operator to check if user money < or = price of chosen item or not
bool operator<=(Stock ob);
///Getter Function to get value of user Money
float getuserMoney();
///Manually Setting items names to Array.
string itemName[10] = {"Pepsi", "Chipsy", "Bake Rolz", "Sun Bites", "Marshmellow",
"KitKat", "Galaxy", "Cadbury", "Lambada", "Tuc"};
///Manually Setting items Prices to Array.
float price[10] = {10, 5, 3, 3, 3, 10, 10, 10, 1.5, 5};
///Boolean Function To Check The Stock Quantity
bool checkStock();
protected:
int Quantity[10];
int choice;
float userMoney;
private:
};
#endif // STOCK_H