-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGreeter.cpp
More file actions
64 lines (55 loc) · 1.81 KB
/
Greeter.cpp
File metadata and controls
64 lines (55 loc) · 1.81 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
#include "IIKH.h"
#include <iostream>
#include <thread>
#include <chrono>
using namespace std;
void Greeter::clearScreen() {
#ifdef _WIN32
system("cls");
#else
system("clear");
#endif
}
void Greeter::printWithDelay(const string& text, int delay) {
for (const char& ch : text) {
cout << ch;
cout.flush();
this_thread::sleep_for(chrono::milliseconds(delay));
}
}
void Greeter::displayWelcomeScreen() {
string border1 = "+---------------------------------------------+";
string border2 = "| |";
string welcomeTitle = "| Welcome to IIKH, Minji! |";
string subtitle = "| Your Interactive Intelligent Kitchen Helper |";
string loadingText = "\nLoading IIKH System...";
string welcomeMessage = "\nLet's make the best meal!";
clearScreen();
cout << border1 << endl;
cout << border2 << endl;
cout << welcomeTitle << endl;
cout << border2 << endl;
cout << subtitle << endl;
cout << border2 << endl;
cout << border1 << endl;
printWithDelay(loadingText);
this_thread::sleep_for(chrono::seconds(2)); // Wait for 2 seconds
cout << welcomeMessage;
this_thread::sleep_for(chrono::seconds(1));
clearScreen();
}
void Greeter::displayGoodbyeScreen() {
string border1 = "+---------------------------------------------+";
string border2 = "| |";
string byeTitle = "| See you next time! |";
string byeMessage = "\nEnjoy your meal!";
clearScreen();
cout << border1 << endl;
cout << border2 << endl;
cout << byeTitle << endl;
cout << border2 << endl;
cout << border1 << endl;
this_thread::sleep_for(chrono::seconds(2));
clearScreen();
cout << byeMessage << endl;
}