-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuiz-Project.cpp
145 lines (139 loc) · 3.55 KB
/
Quiz-Project.cpp
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x=0;
cout<<" "<<"HERE'S AN INTERESTING QUIZ FOR YOU"<<endl<<endl;
cout<<"There are 5 questions"<<endl;
cout<<"Each correct answer will increase your score by 20"<<endl<<endl;
cout<<"According to your score you will get to know some facts";
getch();
clrscr();
int a;
cout<<"The quiz begins like this"<<endl<<endl;
cout<<"Question 1"<<endl;
cout<<"How many sides does a decagon have?"<<endl;
cin>>a;
if(a==10)
{
x=x+20;
cout<<"Your answer is correct"<<endl<<"Your score is "<<x;
}
else
cout<<"Oops! your answer is wrong"<<endl<<"Correct answer is 10";
getch();
clrscr();
int b;
cout<<"Question 2"<<endl;
cout<<"How many straight edges does a cube have?"<<endl;
cin>>b;
if(b==12)
{
x=x+20;
cout<<"Good job"<<endl<<"Your score is "<<x;
}
else
cout<<"Sorry! Correct answer is 12";
getch();
clrscr();
int c;
cout<<"Question 3"<<endl;
cout<<"How many hours are there in 7 days?"<<endl;
cin>>c;
if(c==168)
{
x=x+20;
cout<<"Well done"<<endl<<"Your score is "<<x;
}
else
cout<<"Oh! wrong answer"<<endl<<"Correct answer is 168";
getch();
clrscr();
int d;
cout<<"Question 4"<<endl;
cout<<"What is 60% of 40?"<<endl;
cin>>d;
if(d==24)
{
x=x+20;
cout<<"Nice"<<endl<<"Your score is "<<x;
}
else
cout<<"Bad luck"<<endl<<"Your answer is wrong";
getch();
clrscr();
int e;
cout<<"Question 5"<<endl;
cout<<"What is two thirds of 960?"<<endl;
cin>>e;
if(e==640)
{
x=x+20;
cout<<"Well done "<<endl;
cout<<"Your score is "<<x;
}
else
cout<<"Incorrect answer";
getch();
clrscr();
if(x==100)
{
cout<<"Congratulations!!"<<endl;
cout<<"Your score is "<<x;
cout<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<" "<<"DO YOU KNOW THE MAGIC OF 9?"<<endl<<endl;
cout<<"STEP 1: Multiply any number with 9."<<endl;
cout<<"STEP 2: Sum all individual digits of the result to make it single digit"<<endl;
cout<<"The single digit will always be 9"<<endl<<endl;
cout<<"EXAMPLE: 4532 * 9 = 41328"<<endl;
cout<<"4 + 1 + 3 + 2 + 8 = 18"<<endl;
cout<<"1 + 8 = 9";
}
if(x==80)
{
cout<<"Nice Job"<<endl;
cout<<"Your score is "<<x;
cout<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<" "<<"SEE THE MAGIC OF 1!!"<<endl<<endl;
cout<<"111,111,111 * 111,111,111 = 12345678987654321"<<endl;
cout<<"11,111 * 11,111 = 123454321"<<endl;
cout<<"Notice the pattern of their product";
}
if(x==60)
{
cout<<"Good"<<endl;
cout<<"Your score is "<<x;
cout<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<" A FUNNY FACT"<<endl<<endl;
cout<<"For pizza,"<<endl;
cout<<"Let radius = z,"<<endl;
cout<<" height = a"<<endl;
cout<<"Then,"<<endl<<" volume = pi * z * z * a";
}
if(x==40)
{
cout<<"Not so bad"<<endl;
cout<<"Your score is "<<x;
cout<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<"The mirror image of value of 'pi' i.e., 3.14 is PIE "<<endl;
cout<<"Which is pronounced as pi";
}
if(x==20)
{
cout<<"Unexpected"<<endl;
cout<<"Your score is "<<x;
cout<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<"Among all shapes with the same perimeter a circle has the largest area"<<endl;
cout<<"&"<<endl;
cout<<"Among all shapes with the same area a circle has the smallest perimeter";
}
if(x==0)
{
cout<<"Very Bad"<<endl;
cout<<"Your score is "<<x<<endl;
cout<<endl<<endl<<endl<<endl<<endl;
cout<<"No fact for you";
}
getch();
}