-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhappy.cpp
More file actions
86 lines (63 loc) · 1.77 KB
/
happy.cpp
File metadata and controls
86 lines (63 loc) · 1.77 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
#include <iostream>
using namespace std;
int main() {
int score = 100;
int answer;
cout << "Welcome to the Happiness Quiz!" << endl;
cout << "Answer each question to determine how happy you are!" << endl;
cout << endl;
cout << "Q1) Do you feel lonely?" << endl;
cout << "1) Yes, all the time" << endl;
cout << "2) Sometimes" << endl;
cout << "3) Less than sometimes" << endl;
cout << "4) Never" << endl;
cin >> answer;
if(answer = 1){
score -= 20;
}
cout << "Q2) How often do you experience guilt or hopelessness?" << endl;
cout << "1) All the time" << endl;
cout << "2) Sometimes" << endl;
cout << "3) Less than sometimes" << endl;
cout << "4) Never" << endl;
cin >> answer;
if(answer = 1){
score -= 20;
}
cout << "Q3) How often do you spend time with family and friends?" << endl;
cout << "1) All the time" << endl;
cout << "2) Sometimes" << endl;
cout << "3) Less than sometimes" << endl;
cout << "4) Never" << endl;
cin >> answer;
if(answer = 4){
score -= 20;
}
cout << "Q4) Do you feel as though you have little interest in doing things?" << endl;
cout << "1) All the time" << endl;
cout << "2) Sometimes" << endl;
cout << "3) Less than sometimes" << endl;
cout << "4) Never" << endl;
cin >> answer;
if(answer = 1){
score -= 20;
}
cout << "Q5) Do you often over/undereat?" << endl;
cout << "1) All the time" << endl;
cout << "2) Sometimes" << endl;
cout << "3) Less than sometimes" << endl;
cout << "4) Never" << endl;
cin >> answer;
if(answer = 1){
score -= 20;
}
cout << "Your final score is: " << score << " out of 100" << endl;
cout << "The higher the score, the happier you are" << endl;
if(score > 90){
cout << "You are a very happy person!" << endl;
}
else if(score<=50){
cout << "You are a very depressed person." << endl;
}
return 0;
}