-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ingredient.h
35 lines (28 loc) · 1006 Bytes
/
Ingredient.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
#ifndef INGREDIENT_FILE
#define INGREDIENT_FILE
#include "include.h"
using namespace std;
class Ingredient : public IComparable
{
private:
string name;
int quantity;
string quantityType;
public:
Ingredient() :name(""), quantity(0), quantityType(""){} //default constructor;
Ingredient(string n, int q, string qT):name(n),quantity(q),quantityType(qT){}
//GETTERS
string getName(void) const { return name ;};
int getQuantity(void) const { return quantity; };
string getQuantityType(void) const { return quantityType; };
//SETTERS
void setName(string n) { name = n; };
void setQuantity(int q) { quantity = q; };
void setQuantityType(string qT) { quantityType = qT; };
bool operator ==(const IComparable& theOther);
Ingredient operator =(const Ingredient& theOther);
friend istream &operator>>(istream &in, ostream& out);
friend string &operator>>(string &line, Ingredient& ingredient);
friend ostream &operator<<(ostream &out,const Ingredient& theOther);
};
#endif INGREDIENT_FILE