-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
74 lines (73 loc) · 2.5 KB
/
Copy pathmain.cpp
File metadata and controls
74 lines (73 loc) · 2.5 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
#include <iostream>
int main() {
std::cout << "====================================================\n";
std::cout << "/===\\ | | /===\\ | | /====\\ |\\ | |==== \n";
std::cout << "| | | |===/ | | | | | \\ | |\n";
std::cout << "| ===== ===== | |===| | | | \\ | |====\n";
std::cout << "| | | | | | | | | \\ | |\n";
std::cout << "\\===/ | | | | | \\====/ | \\| |====\n";
std::cout << "====================================================\n";
// List apps
std::cout << "Apps: \n";
std::cout << "1. Calculator\n";
std::cout << "2. Text Editor\n";
std::cout << "3. Terminal\n";
std::cout << "4. Settings\n";
std::cout << "5. About\n";
std::cout << "6. Exit\n";
std::cout << "====================================================\n";
std::cout << "Enter the number of the app you want to open: ";
int app;
std::cin >> app;
if (app == 1) {
std::cout << "Calculator\n";
} else if (app == 2) {
std::cout << "Text Editor\n";
} else if (app == 3) {
std::cout << "Terminal\n";
} else if (app == 4) {
std::cout << "Settings\n";
} else if (app == 5) {
std::cout << "About\n";
} else if (app == 6) {
std::cout << "Exit\n";
} else {
std::cout << "Invalid input\n";
}
if (app == 1) {
std::cout << "Enter the first number: ";
double num1;
std::cin >> num1;
std::cout << "Enter the second number: ";
double num2;
std::cin >> num2;
std::cout << "Enter the operator: ";
char op;
std::cin >> op;
if (op == '+') {
std::cout << num1 + num2 << std::endl;
} else if (op == '-') {
std::cout << num1 - num2 << std::endl;
} else if (op == '*') {
std::cout << num1 * num2 << std::endl;
} else if (op == '/') {
std::cout << num1 / num2 << std::endl;
} else {
std::cout << "Invalid operator\n";
}
}
if (app == 3) {
std::cout << "Enter the command: ";
std::string command;
std::cin >> command;
if (command == "help") {
std::cout << "help - Shows this message\n";
std::cout << "exit - Exits the terminal\n";
} else if (command == "exit") {
std::cout << "Exiting terminal...\n";
} else {
std::cout << "Invalid command\n";
}
}
return 0;
}