Top Banner
20
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: C++ typing tutor by debakar roy
Page 2: C++ typing tutor by debakar roy

ACKNOWLEDGEMENT It gives me great pleasure to express my

gratitude towards our Computer Science

teacher Mrs. Sabiha Shahin for her guidance,

support and encouragement throughout the

duration of the project. Without her motivation

and help the successful completion of this

project would not have been possible.

Page 3: C++ typing tutor by debakar roy

CERTIFICATE

This is to certify that DEBAKAR ROY, a student of

class XII-SC has successfully completed the research

on the below mentioned project under the guidance of

Mrs. Sabiha Shahin ( Subject Teacher) during the

year 2014-15 in partial fulfillment of chemistry

practical examination conducted by AISSCE, New

Delhi.

SIGN

Page 4: C++ typing tutor by debakar roy

ABOUT THE PROGRAM

Typing is the basic command to run a computer and

your typing speed plays vital role while working in

computer to save time. Here I have presented a Typing

Tutor Project in C++ to measure user’s typing speed and

to enhance their typing speed. This is a simple console

application written in C++ programming language, and

compiled using Turbo C++ by NeuTron.

PROGRAM CODE

Page 5: C++ typing tutor by debakar roy

/*

TYPING TUTOR BY DEBAKAR ROY

*/

#include<iostream.h>

#include<conio.h>

#include<string.h>

#include<stdio.h>

#include<stdlib.h>

#include<ctype.h>

#include<dos.h>

#include<time.h>

#include<fstream.h>

#include<graphics.h>

#include<process.h>

void basics();

void letters();

void sentence();

void main()

{

clrscr();

int opt;

menu:

clrscr();

cout<<"\n\n\t\t\t =====TYPING TUTOR =====";

cout<<"\n\n\n\t\t ::MAIN MENU::";

cout<<"\n\n\t\t1.Learn basics";

cout<<"\n\n\t\t2.Type the letters";

cout<<"\n\n\t\t3.Type the sentence";

Page 6: C++ typing tutor by debakar roy

cout<<"\n\n\t\t0.Exit";

cout<<"\n\n\n\t\tEnter your chice : ";

cin>>opt;

switch(opt)

{

case 1: basics();

goto menu;

break;

case 2: letters();

goto menu;

break;

case 3: sentence();

goto menu;

break;

case 0: exit(0);

break;

default: goto menu;

break;

}

}

void basics()

{

clrscr();

int rep;

char choice1,choice2;

char key;

char mid[]="asdfgf ;lkjhj";

char top[]="qwertr poiuyu";

char bot[]="zxcvbv /.,mnm";

Page 7: C++ typing tutor by debakar roy

cout<<"\n\nHello! I think you are new dude to the world of fast typing.";

delay(1000);

cout<<"\n\nAnd as I have now agreed to teach you how to be fast in typing......";

delay(1000);

cout<<"\n\nLet us start.Are you ready ?(y/n)";

cin>>choice1;

if(choice1=='y'||choice1=='Y')

{

clrscr();

cout<<"\n\nUnderstand, it is very to do this....";

delay(1000);

cout<<"\n\nFollow me.......";

delay(1000);

cout<<"\n\nPress any key to start.";

getch();

cout<<"\n\nLet us study the basics....";

delay(1000);

cout<<"\n\nFirst you have to learn the mid 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...";

Page 8: C++ typing tutor by debakar roy

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(100);

nosound();

sound(700);

delay(100);

nosound();

}

}

}

//Top row

cout<<"\n\nNow you have to learn the top row.....";

cout<<"\n\nHow many times do you want to practice : ";

Page 9: C++ typing tutor by debakar roy

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:"<<top[j];

cout<<"\tYou entered:";

key=getche();

if(key==top[j])

{

cout<<"\tCorrect..";

sound(300);

delay(200);

nosound();

}

else

{

cout<<"\tWrong";

sound(600);

delay(100);

Page 10: C++ typing tutor by debakar roy

nosound();

sound(700);

delay(100);

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])

{

Page 11: C++ typing tutor by debakar roy

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\nOh! I think you are busy. OK See you later.......";

delay(3000);

}

}

void letters()

{

randomize();

char choice;

int num;

Page 12: C++ typing tutor by debakar roy

int score=0,randnum;

char letter,key;

clrscr();

cout<<"In this test you will have to type the letters you see on the screen.";

delay(1000);

cout<<"\n\nDo you want to see the help menu ?(y/n)";

choice=getche();

if(choice=='y'||choice=='Y')

{

cout<<"\n\n1.You are to type the random letters 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();

}

Page 13: C++ typing tutor by debakar roy

}

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

{

Page 14: C++ typing tutor by debakar roy

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 is spped test to try your speed.\n";

delay(1000);

type:

cout<<"\nYou will have to 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.";

cout<<"\n\nEnter the sentence:";

gets(line);

t2 = time(NULL);

Page 15: C++ typing tutor by debakar roy

if(!strcmp(line,"I am learning to type."))

{

cout<<"\n\nYou could type the sentence in "<<t2-t1<<" seconds.";

getch();

}

else

{

cout<<"\n\nThe sentence you typed was wrong..";

getch();

goto type;

}

}

Page 16: C++ typing tutor by debakar roy

SCREENSHOT

Page 17: C++ typing tutor by debakar roy
Page 18: C++ typing tutor by debakar roy
Page 19: C++ typing tutor by debakar roy
Page 20: C++ typing tutor by debakar roy

CONCLUSION

This Project is especially made for beginner

who started learning computer and are new in

typing. And the code for this program and

compiled file is given in the CD provided with

this project. There you will also find some

software to run it.

Bibliography

Effective Modern C++ Scott Meyers

C++ Programming for Beginners Beryl Hoffman

Starting Out with C++ Tony Gaddis

EXTERNAL HELP

Thanks to google.com to help me get my

error rectify.