-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCoffee Maker for IUS.cpp
More file actions
106 lines (92 loc) · 3.45 KB
/
Coffee Maker for IUS.cpp
File metadata and controls
106 lines (92 loc) · 3.45 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
// TryCoffe1.cpp : First version of the file, started on 10.12.2022. (December 12th 2022)
// Coffee_Maker_for_IUS.cpp : Last version of the file, ended on __.12.2022. (December __ 2022)
// Team members: - Ammar Omerika 220302227 SE
// - Selma Alic 220302129 CSE
// - Omer Becic 220302287 SE
// - Altan Berk Eren 210302301 SE
#include <iostream>
#include <cstdlib>
#include "operationMode.h"
#include "settingMode.h"
#include "qualityOfLife.h"
#include "log.h"
using std::cin;
using std::cout;
using std::endl;
using std::string;
int main()
{
//FUNCTIONAL VARIABLES
char setModeOrUserMode; //Which mode to use
char endOfTheDay; //Finish the machine
//COFFEE VARIABLES
string coffeeNames[5] = { "Espresso", "Cappucino", "Hot Chocolate", "Melange", "Americano"};
int coffeeCups[5] = { 3,3,3,3,3 }; //Number of each coffee
double coffeePrices[5] = { 2,2,3.5,3,1.5 }; //Prices of coffees
int CoffeePosition; //Index of choosen coffee
double Change; //Change that will be given back
//COIN VARIABLES
const long double coinsValue[7] = { 0.05,0.1,0.2,0.5,1,2,5 }; //Value of coins
int coinsAmount[7] = {3,3,3,3,3,3,3}; //Amount of coins
bool coinsAllowed[7] = {true, true, true, true, true, true, true}; //Acceptable coins
do {
//MODE MENU
oasis1:
white();
cls();
cout << "Do you wish the use the setting mode or operation mode <s/o>" << endl << "~> ";
cin >> setModeOrUserMode;
cls();
if (setModeOrUserMode == 's') {
yello();
cinFlush();
settingModeMenu(coinsValue, coffeePrices, coffeeNames, coinsAmount, coffeeCups, coinsAllowed);
white();
}
else if (setModeOrUserMode == 'o') {
purple();
cinFlush();
CoffeePosition = ReturnCoffeePosition(coffeeCups,coffeeNames);
Change= CoffeePayment(coinsAmount, coinsAllowed, coffeePrices, CoffeePosition);
ReturnMoney(coinsValue,coinsAmount,coinsAllowed,Change);
CoffeePour(coffeeCups,CoffeePosition);
white();
}
else if (setModeOrUserMode == 'e') {
cinFlush();
easterEgg();
}
else {
cout << "Invalid input" << endl;
cinFlush();
pause();
goto oasis1;
}
//CONTINUE OR NOT
oasis2:
cout << "Do you wish to use the machine more? <y/n>" << endl << "~> ";
cin >> endOfTheDay;
if (endOfTheDay == 'y') {
cout << endl;
cinFlush();
}
else if (endOfTheDay == 'n') {
cout << endl;
cinFlush();
break;
}
else {
cout << "Invalid input" << endl;
pause();
cinFlush();
goto oasis2;
}
} while (true);
//END OF THE DAY EVALUATION
cout << "END OF THE DAY EVALUATION: " << endl;
cout << "Creating file"; loading(); pause();
logCoffee(coffeeNames, coffeePrices, coinsValue, coffeeCups, coinsAmount, coinsAllowed);
cout << "Look for it in the text file attached ;)" << endl;
system("notepad.exe database.txt"); // ACTUALLY OPENS UP THE FILE XD!!!!!!!!@!@q!!@!@!!!!!!!retwe%yre^%#qrt
return 0;
}