50% found this document useful (2 votes)
2K views17 pages

Typing Tutor

This document is a project report submitted by Dhananjay Sharma for a typing tutor program developed in C++. The summary includes: 1) Dhananjay Sharma developed a typing tutor program in C++ under the guidance of his teacher Er. Dharmendra Thakur to measure a user's typing speed and help improve it. 2) The program displays text for the user to type, records the typing in a file, compares it to the original text to identify errors, and displays the results with errors highlighted. 3) The report provides details on the program requirements, source code structure including functions and files used, and sample output.

Uploaded by

Dhananjay Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
2K views17 pages

Typing Tutor

This document is a project report submitted by Dhananjay Sharma for a typing tutor program developed in C++. The summary includes: 1) Dhananjay Sharma developed a typing tutor program in C++ under the guidance of his teacher Er. Dharmendra Thakur to measure a user's typing speed and help improve it. 2) The program displays text for the user to type, records the typing in a file, compares it to the original text to identify errors, and displays the results with errors highlighted. 3) The report provides details on the program requirements, source code structure including functions and files used, and sample output.

Uploaded by

Dhananjay Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

SUBMITTED TO:

Er. Dharmendra Thakur


P G T Computer
science
AISSE 2014-2015
SUBMITTED BY:
NAME:
Sharma
C

Dhananjay

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
Numb
er

Topic

Introduction

Hardware and Software


Requirements

Source Code

Output

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 users 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 REQUIREMENTAn 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 REQUIREMENTThe 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 Aroras Class XII Computer
Science Text Book

You might also like