-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
44 lines (34 loc) · 1.19 KB
/
Copy pathmain.cpp
File metadata and controls
44 lines (34 loc) · 1.19 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
#include <iostream>
#include <string>
using namespace std;
int main() {
string choice;
char power;
bool powerOn = false;
cout << "=== Coffee Machine Program ===" << endl;
// Start
cout << "Press 'Y' to Power On: ";
cin >> power;
if (power == 'Y' || power == 'y') {
powerOn = true;
cout << "\nMachine Powered ON ✅" << endl;
// Loop until user powers off
while (powerOn) {
// Coffee Selection
cout << "\nSelect Coffee (Latte / Mocha / Espresso): ";
cin >> choice;
if (choice == "Latte" || choice == "latte") {
cout << "\nPreparing Latte..." << endl;
cout << "Adding frothed milk..." << endl;
cout << "Adding hot coffee..." << endl;
}
else if (choice == "Mocha" || choice == "mocha") {
cout << "\nPreparing Mocha..." << endl;
cout << "Adding chocolate powder..." << endl;
cout << "Adding frothed milk..." << endl;
cout << "Adding hot coffee..." << endl;
}
}
cout << "\n=== Program Ended ===" << endl;
return 0;
}