-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkasir.cpp
More file actions
106 lines (96 loc) · 2.26 KB
/
Copy pathkasir.cpp
File metadata and controls
106 lines (96 loc) · 2.26 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#include <iostream>
using namespace std;
int main() {
// variabel
int nasi = 3000;
int ayam_goreng = 7000;
int ikan_goreng = 5000;
int teh_tawar = 2000;
int teh_manis = 4000;
int pilih;
int kuantitas;
int total = 0;
int bayar;
int kembali;
char ulang;
char reset;
// program
do {
cout << "----------------------" << endl;
cout << "Kasir Warteg Sederhana" << endl;
cout << "----------------------" << endl;
cout << "MENU" << endl;
cout << "1. Nasi" << endl;
cout << "2. Ayam Goreng" << endl;
cout << "3. Ikan Goreng" << endl;
cout << "4. Teh Tawar" << endl;
cout << "5. Teh Manis" << endl;
cout << "Menu yang dipesan : ";
cin >> pilih;
cout << "Berapa banyak : ";
cin >> kuantitas;
if (pilih == 1) {
total += (nasi * kuantitas);
}
else if (pilih == 2) {
total += (ayam_goreng * kuantitas);
}
else if (pilih == 3) {
total += (ikan_goreng * kuantitas);
}
else if (pilih == 4) {
total += (teh_tawar * kuantitas);
}
else if (pilih == 5) {
total += (teh_manis * kuantitas);
}
else {
cout << "pesan tidak ada di menu" << endl;
cout << endl;
cout << "Copyright 2020 Adam Zein" << endl;
system("PAUSE");
return 0;
}
cout << endl;
cout << "Pesan lagi (y/n) ? ";
cin >> ulang;
cout << endl;
if (ulang == 'n') {
cout << "Total harga : " << total << endl;
cout << "Masukan uang : ";
cin >> bayar;
kembali = bayar - total;
cout << "Kembalian : " << kembali << endl;
cout << endl;
cout << "Reset kasir atau tutup aplikasi (r/c) ? ";
cin >> reset;
cout << endl;
if (reset == 'r') {
system("cls");
total = 0;
ulang = 'y';
}
else if (reset == 'c') {
cout << "Terimakasih..";
cout << endl;
cout << "Copyright 2020 Adam Zein" << endl;
system("PAUSE");
return 0;
}
else {
cout << "input yang dimasukan tidak sesuai";
cout << endl;
cout << "Copyright 2020 Adam Zein" << endl;
system("PAUSE");
return 0;
}
}
else if (ulang != 'y') {
cout << "input yang dimasukan tidak sesuai";
cout << endl;
cout << "Copyright 2020 Adam Zein" << endl;
system("PAUSE");
return 0;
}
} while (ulang == 'y');
}