-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDish.h
84 lines (78 loc) · 1.46 KB
/
Dish.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
#include <iostream>
#include<string>
#include<string.h>
#include<vector>
#include<iomanip>
using namespace std;
#pragma once
enum type_dish{ cold=1, hot, desert,untyped };
class Dish
{
public:
string title;
double price;
type_dish type;
public:
Dish operator +( int i)
{
this->price += i;
return *this;
}
Dish operator -(int i)
{
this->price -= i;
return *this;
}
operator double(){ return this->price; }
friend ostream & operator << (ostream & os,const Dish obj )
{
os <<"Name "<<obj. title << endl;
os <<"Price "<< obj.price << endl;
switch (obj.type)
{case cold:
os << "Cold dish. \n";
break;
case hot:
os << "Hot dish.\n ";
break;
case desert:
os << "Desert. \n";
break;
case untyped:
os << "Untyped. \n";
break;
default:
break;
}
//os << endl;
return os;
}
//////////////////////////////
void editTitle();
void editPrice();
void editType();
void editDish();
string printType();
//////////////////////////
Dish getDish();
string getTitle();
double getPrice();
type_dish getType();
string pbTitle(string);
string o0Title(string);
/////////////////////////////////
bool equTitle(string);
bool equPrice(double);
bool equType(type_dish);
//////////////////////////
void setAll();
void setTitle(string);
void setPrice(double);
void setType(type_dish);
void setType(string);
//////////////////////////
Dish(string , double , type_dish );
Dish(const Dish &);
Dish();
~Dish();
};