forked from lcosta/um_uc_prog_tp2
/
shop.h
90 lines (64 loc) · 1.39 KB
/
shop.h
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
#ifndef _shop_h_
#define _shop_h_
#include <string>
#include <iostream>
#include <fstream>
#include "generic_data.h"
using namespace std;
class Shop : public GenericData {
protected:
int _id_pharmacy;
int _id_drug;
int _quantity;
bool _comp;
int _total_value;
public:
Shop(int id ,int idPharmacy, int idDrug, string name, int quantity, bool comp, int totalValue);
~Shop();
// START: gets and sets
int getIdPharmacy() const{
return _id_pharmacy;
}
int getIdDrug() const{
return _id_drug;
};
int getQuantity() const{
return _quantity;
};
int getTotalValue() const{
return _total_value;
};
bool getComp() const{
return _comp;
};
void setIdPharmacy(int id){
_id_pharmacy = id;
};
void setIdDrug(int id){
_id_drug = id;
};
void setQuantity(int quantity){
_quantity = quantity;
};
void setComp(bool comp){
_comp = comp;
};
void setTotalValue(int totalValue){
_total_value = totalValue;
};
// END: gets and sets
// START: methods
void print();
void write(std::ostream &out);
// END: methods
};
//----------cpp
Shop::Shop(int id,int idPharmacy, int idDrug, string name, int quantity, bool comp, int totalValue) : GenericData(id, name)
{
Shop::_id_pharmacy = idPharmacy;
Shop::_id_drug = idDrug;
Shop::_quantity = quantity;
Shop::_comp = comp;
Shop::_total_value = totalValue;
}
#endif