-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.cpp
More file actions
70 lines (65 loc) · 1.25 KB
/
data.cpp
File metadata and controls
70 lines (65 loc) · 1.25 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
#include <iostream>
#include "data.h"
#include "kontrola_liczb.h"
#include "input.h"
#include <string>
using namespace std;
string podaj_imie() {
string imie;
cout << "Podaj swoje imie: ";
getline(cin, imie);
input(imie);
return imie;
};
bool podaj_miejsce()
{
string odp;
cout << "Czy chcesz zlozyc zamowienie na miejscu czy z dowozem?" << endl;
while (true) {
cout << "M - na miejscu, D - z dowozem: ";
getline(cin, odp);
input(odp);
if (odp == "M" || odp == "m")
{
return true;
}
else if (odp == "D" || odp == "d")
{
return false;
}
else
{
cout << "Podano bledna odpowiedz!" << endl;
}
}
};
int nr_stolika() {
int nr;
bool blad;
do
{
blad = false;
cout << "Podaj nr stolika ktory chcesz zajac (1-50)"<<endl;
nr = kontrola_liczby();
if (nr > 50 || nr < 1)
{
cout << "Bledny numer stolika"<<endl;
blad = true;
}
}
while (blad);
return nr;
};
void podaj_adres(string & miejscowosc, string & ulica, int & nr_domu, int & nr_mieszkania)
{
cout << "Podaj miejscowosc: ";
getline(cin, miejscowosc);
input(miejscowosc);
cout << "ulica: ";
getline(cin, ulica);
input(ulica);
cout << "numer domu: ";
nr_domu = kontrola_liczby();
cout << "numer mieszkania : ";
nr_mieszkania = kontrola_liczby();
};