SUBMITTED TO:
Er. Dharmendra Thakur
P G T Computer
science
AISSE 2014-2015
SUBMITTED BY:
NAME: Dhananjay
Sharma
C
KENDRIYA VIDYALAYA
MOSCOW
CERTIFICATE
This is to certify that Dhananjay
Sharma (Exam Roll Number) of class
XII has completed his project titled
“Typing Tutor” under the guidance
of Er. Dharmendra Thakur & this
project may be considered as the
part of the practical exam of AISSCE
conducted by CBSE for the academic
session 2014-15.
Teacher I/C
Er.
Dharmendra Thakur
ACKNOWLEDGEMEN
T
It would be my utmost pleasure to
express my sincere thanks to My
Computer Science Teacher Er.
Dharmendra Thakur in providing a
helping hand in this project. His
unflagging patience, creativity and
immense knowledge that she shared
with me have proved highly
beneficial to me and have made my
Project File both possible and
successful.
Dhananjay Sharma
XII
INDEX
Serial Topic
Numb
er
1 Introduction
2 Hardware and Software
Requirements
3 Source Code
4 Output
5 Bibliography
INTRODUCTION
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
GNU GCC compiler.
The source code of Typing Tutor Project in C+
+ consists of over 200 lines of code that are
made user friendly by attaching comments to
describe the function of each command. The
project source code effectively utilizes the
user defined functions and the concept of file
handling.
HARDWARE & SOFTWARE
REQUIREMENTS
(A) HARDWARE REQUIREMENT-
An Intel based central processing unit capable of
running any sort of windows operating system such
as Pentium based workstation.
Minimum 64 MB RAM (128 MB Desirable) at
server.
Minimum 60 MB of free disk space for files.
A CD Rom drive
Minimum 48 MB of RAM at workstation.
VGA 15” color monitor for workstation.
(B) SOFTWARE REQUIREMENT-
The software requirements are as follows.
Windows 98 or Above
C++ editor
Microsoft word or any other text editor
Header Files Used
#include<iostream.h>
#include<windows.h>
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<fstream>
#include<string.h>
#include<windows.h>
#include<fstream.h>
#include<ctime.h>
Text Files Used
Book.txt
Typed.txt
Corrected.dat
Class Used
WORDS
Function Names Used
void checking();
void display(double)
void main()
void checking()
void display(double dif)
SOURCE CODE
#include<iostream.h>
#include<windows.h>
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<fstream>
#include<string.h>
#include<windows.h>
#include<fstream.h>
#include<ctime.h>
void checking();
void display(double);
enum check{correct,incorrect};
class words
{
public:
char word[20];
check cword;
check cchar[20];
};
void main()
ifstream fin("Book.txt");
char ch;
char wrd[20];
time_t start,end;
double dif;
cout<<"\n Enter the text below. Press 0 to finish typing.
\n";
Sleep(100);
while(!fin.eof())
fin>>wrd;
cout<<wrd<<" ";
cout<<endl;
fin.close();
ofstream fout("Typed.txt");
time (&start);
while(ch!='0')
ch=getche();
if(ch!='0')
fout<<ch;
time (&end);
cout<<"\n Please wait while we process your result. \n";
dif = difftime (end,start);
fout.close();
checking();
display(dif);
void checking()
words w;
char wrd[20];
ifstream fin("Book.txt");
ifstream type("Typed.txt");
fstream fout;
fout.open("Corrected.dat",ios::out);
int i,j,k,l;
while(!type.eof())
fin>>wrd;
type>>w.word;
j=0;
k=0;
l=strlen(w.word);
for(i=0;w.word[i]!='\0';i++)
rajat:
if(w.word[i]==wrd[j])
w.cchar[i]=correct;
else
w.cchar[i]=incorrect;
k++;
if(i!=l)
i++;
goto rajat;
else
i=j;
j++;
if(k==0)
w.cword=correct;
else{
w.cword=incorrect;
fout.write((char*)&w,sizeof(w));
fin.close();
type.close();
fout.close();
void display(double dif)
HANDLE hConsole;
hConsole = GetStdHandle (STD_OUTPUT_HANDLE);
fstream fin;
fin.open("Corrected.dat",ios::in);
words w;
cout<<"\n You took "<<dif<<" seconds to enter the
text.";
cout<<"\n The typed text with mistakes are highlighted
in red. \n";
while(fin.read((char*)&w,sizeof(w)))
if(w.cword==correct)
SetConsoleTextAttribute
(hConsole, FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<w.word;
else
for(int i=0;w.word[i]!='\0';i++)
if(w.cchar[i]==correct)
SetConsoleTextAttribute
(hConsole, FOREGROUND_BLUE |
FOREGROUND_INTENSITY);
cout<<w.word[i];
else
SetConsoleTextAttribute
(hConsole, FOREGROUND_RED |
FOREGROUND_INTENSITY);
cout<<w.word[i];
cout<<" ";
SetConsoleTextAttribute
(hConsole, FOREGROUND_RED | FOREGROUND_GREEN |
FOREGROUND_BLUE );
cout<<endl;
//**************************************************************************
// END OF PROJECT
//**************************************************************************
OUTPUT
SCREENSHOT
BIBLIOGRAPHY
www.google.com
www.cpp4u.com
www.cppforschool.com
Sumita Arora’s Class XII Computer
Science Text Book