-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTUTOR.cpp
More file actions
284 lines (278 loc) · 5.44 KB
/
TUTOR.cpp
File metadata and controls
284 lines (278 loc) · 5.44 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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
#include<iostream>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<dos.h>
#include<time.h>
#include<graphics>
using namespace std;
void simple();
void alphabets();
void sentence();
void main()
{
clrscr();
int c;
menu:
clrscr();
cout<<"\n\n\t\t\t Made By Chirag Jain
cout<<"\n\n\t\t\t =====TYPING TESTER =====";
cout<<"\n\n\n\t\t ::MAIN MENU::";
cout<<"\n\n\t\t1.Learn Simple Things";
cout<<"\n\n\t\t2.Type Alphabets";
cout<<"\n\n\t\t3.Type the sentence";
cout<<"\n\n\t\t0.Exit";
cout<<"\n\n\n\t\tEnter your choice : ";
cin>>c;
switch(c)
{
case 1: simple();
goto menu;
case 2: alphabets();
goto menu;
case 3: sentence();
goto menu;
case 0: exit(0);
break;
default: goto menu;
}
}
void simple()
{
clrscr();
int rep;
char choice1,choice2;
char key;
char mid[]="akdfss: ";lkjhj";
char top[]="qruot[]ptouyu";
char bot[]="zxcvnv /.,mnm";
cout<<"\n\nHello Friend! Here you can learn to type Fast.";
delay(1000);
cout<<"This Application is developed by Chirag Jain";
delay(2000);
cout<<"\n\nAnd now we are going to Start......";
delay(1000);
cout<<"\n\nLet us start.Are you ready ?(y/n)";
cin>>choice1;
if(choice1=='y'||choice1=='Y')
{
clrscr();
cout<<"\n\nOK, it is very simple to do this....";
delay(1000);
cout<<"\n\nFollow.......";
delay(1000);
cout<<"\n\nPress any key to start.";
getch();
cout<<"\n\nLet us study the simple topics....";
delay(1000);
cout<<"\n\nLet us start with Middle Row.....";
cout<<"\n\nHow many times do you want to practice : ";
cin>>rep;
cout<<"\n\nType what you see on the screen...";
for(int i=0;i<rep;++i)
{
for(int j=0;j<13;++j)
{
cout<<"\n\nEnter this:"<<mid[j];
cout<<"\tYou entered:";
key=getche();
if(key==mid[j])
{
cout<<"\tCorrect..";
sound(300);
delay(200);
nosound();
}
else
{
cout<<"\tWrong";
sound(600);
delay(95);
nosound();
sound(700);
delay(100);
nosound();
}
}
}
//Top row
cout<<"\n\nLet us study the top row.....";
cout<<"\n\nHow many times do you want to practice : ";
cin>>rep;
cout<<"\n\nType what you see on the screen...";
for(i=0;i<rep;++i)
{
for(int j=0;j<13;++j)
{
cout<<"\n\nEnter this:"<<top[j];
cout<<"\tYou entered:";
key=getche();
if(key==top[j])
{
cout<<"\tCorrect..";
sound(400);
delay(180);
nosound();
}
else
{
cout<<"\tWrong";
sound(600);
delay(95);
nosound();
sound(800);
delay(110);
nosound();
}
}
}
//Bottom Row
cout<<"\n\nFirst you have to learn the bottom row.....";
cout<<"\n\nHow many times do you want to practice : ";
cin>>rep;
/* cout<<"\n\nDo you want to see the finger positioning ?(y/n)";
cin>>choice2;
if(choice2=='y'||choice2=='Y')
{
************************************
cout<<"\n\nUnder development..........";
getch();
} */
cout<<"\n\nType what you see on the screen...";
for(i=0;i<rep;++i)
{
for(int j=0;j<13;++j)
{
cout<<"\n\nEnter this:"<<bot[j];
cout<<"\tYou entered:";
key=getche();
if(key==bot[j])
{
cout<<"\tCorrect..";
sound(300);
delay(200);
nosound();
}
else
{
cout<<"\tWrong";
sound(600);
delay(100);
nosound();
sound(700);
delay(100);
nosound();
}
}
}
} //wanna learn
else
{
cout<<"\n\nOK! If you wanna go then no problem.......";
delay(3000);
}
}
void alphabets()
{
randomize();
char choice;
int num;
int score=0,randnum;
char letter,key;
clrscr();
cout<<"In this test you will have to type the alphabets you see on the screen.";
delay(1000);
cout<<"\n\nDo you want me to help?(y/n)";
choice=getche();
if(choice=='y'||choice=='Y')
{
cout<<"\n\n1.You have to type the random alphabets you see on the screen.";
delay(2000);
cout<<"\n\n2.If your answer is correct you can hear this beep.";
while(!kbhit())
{
sound(300);
delay(200);
nosound();
}
getch();
cout<<"\n\n3.If your answer is wrong you will hear this";
while(!kbhit())
{
sound(600);
delay(100);
nosound();
sound(700);
delay(100);
nosound();
}
}
cout<<"\n\nPress any key when you are ready.";
getch();
int number;
cout<<"\n\nWhat should be the max score:";
cin>>number;
for(int i=0;i<number;i++)
{
clrscr();
randnum=random(25);
for(int j=0;j<randnum;j++)
cout<<"\n";
randnum=random(25);
for(j=0;j<randnum;j++)
cout<<"\t";
num=65+random(25);
letter=(char)num;
cout<<letter;
key=getch();
if(key==letter)
{
sound(300);
delay(200);
nosound();
score++;
}
else
{
sound(600);
delay(200);
nosound();
sound(700);
delay(200);
nosound();
}
}
cout<<"\n\n\nYour total score is "<<score;
getch();
}
void sentence()
{
clrscr();
time_t t1,t2;
char line[300];
cout<<"This will test your speed\n";
delay(1000);
type:
cout<<"\nJust type the sentence given.\n";
delay(1000);
cout<<"\n\nPress any key to start.";
getch();
clrscr();
t1 = time(NULL);
cout<<"I am learning to type.This is my first typing lesson.";
cout<<"\n\nEnter the sentence:";
gets(line);
t2 = time(NULL);
if(!strcmp(line,"I am learning to type.This is my first typing lesson.After this I will become maestro in Typing World. hahaha"))
{
cout<<"\n\nYou typed the sentence in "<<t2-t1<<" seconds.";
getch();
}
else
{
cout<<"\n\nThe sentence you typed was wrong..";
getch();
goto type;
}
}