-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfortune.cpp
More file actions
55 lines (30 loc) · 1.25 KB
/
fortune.cpp
File metadata and controls
55 lines (30 loc) · 1.25 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
"Developer: Hosna Hamdieh"
"Practicing condidtions using if, else if and else"
#include <iostream>
#include <stdlib.h>
#include <ctime>
int main() {
srand (time(NULL));
int fortune = rand() % 10;
if (fortune == 0) {
std::cout << "Flattery will go far tonight.\n";
} else if (fortune == 1) {
std::cout << "Don't behave with cold manners.\n";
} else if (fortune == 2) {
std::cout << "May you someday be carbon neutral\n";
} else if (fortune == 3) {
std::cout << "You have rice in your teeth.\n";
} else if (fortune == 4) {
std::cout << "A conclusion is simply the place where you got tired of thinking.\n";
} else if (fortune == 5) {
std::cout << "No snowflake feels responsible in an avalanche.\n";
} else if (fortune == 6) {
std::cout << "He who laughs last is laughing at you.\n";
} else if (fortune == 7) {
std::cout << "If you look back, you'll soon be going that way.\n";
} else if (fortune == 8) {
std::cout << "You will die alone and poorly dressed.\n";
} else if (fortune == 9) {
std::cout << "The fortune you seek is in another cookie.\n";
}
}