Class 12 Python Project Typing

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 21

NANDHA CENTRAL CITY SCHOOL [CBSE]

ERODE-638011

COMPUTER SCIENCE PROJECT


TYPING SPEED TEST

Submitted in partial fulfillment of the requirement of the


ALL INDIA SENIOR SECONDARY CERTIFICATE
EXAMINATION (AISSCE)

DEVELOPED BY:
B.GAURAV RAJPUROHIT

(Register No :)

1
NANDHA CENTRAL CITY SCHOOL [CBSE]
ERODE-638011

CERTIFICATE
This is to certify that B.GAURAV RAJPUROHIT. of class XII commerce of
Nandha Central City School has successfully completed the Computer Science
project entitled “TYPING SPEED TEST” for the partial fulfillment of
AISSCE as prescribed by CBSE in the year 2022-23.

Signature of the Guide Signature of the Principal

Signature of the Internal Signature of the external


Examiner Examiner

2
ACKNOWLEDGEMENT

First and foremost I praise and thank almighty from the depth of my
heart, which has been the source of strength in the completion of my
project.

I extend my sincere thanks to Mr.A.G.Prakash Nair,MA (Eng), MA


(Soc), LLB, LLM, MBA, B.Ed Principal, for his co-ordination in
extending every possible support for the completion of this project.

I would like to express a deep sense of thanks & gratitude to my teacher


in charge Mr.G.Manickasundaram.MCA., for guiding me immensely
through the course of the project. He always evinced keen interest in
my work.

I also thank my Parents for their motivation & support. I must thank my
classmates for their timely help and support for completion of this
project.

Last but not least, I would like to thank all those who had helped
directly or indirectly towards the completion of this project.

3
INDEX

S.NO CONTENTS PAGE NO.

1. Problem Definition 6

2. Problem Analysis 8

3. Hardware and Software Requirements 9

4. Scope for Future Enhancement 10

5. Source Code 13

6. Output 16

7. Bibliography 21

4
CONTENTS

 Problem Definition

 Problem Analysis

 Hardware and Software Requirements

 Scope for Future Enhancement

 Source Code

 Output

 Bibliography

5
PROBLEM DEFINITION:

Typing is the process of writing or inputting text by pressing keys on a


typewriter, Computer Keyboard ,Cell Phone, or Calculator. It can be
distinguished from other means of text input, such as handwriting and
speech recognition. Text can be in the form of letters, numbers and other
symbols.

One of the most important reasons for teaching keyboarding to


students is to provide technical skill. Keyboarding has become a
necessary skill for education and most careers. It has even become an
integral part of social relationships, helping to support email, social
media, and other forms of communication.

Typing Fast and Accurate can be difficult. It’s becoming more and more
common for students to take notes on computers in college and even in
high school. And it makes sense. A proficient typist can record down
ideas much faster than anyone can write by hand.

6
MEMBER FUNCTION USED IN APPLICATION:

 start_screen() : It consists of text for welcoming the user and make an


environment for the user to type in.

 display_text() : It will display different random texts, which user can


type in to find his words per minute and accuracy

 load_text(): It will load the random texts, from the text while .

 wpm_test(): It will calculate the WPM, and accuracy of the user. It will
calculate WPM by calculating no.of characters typed by 5.

 main() :This function will get the input from the user and will be typed
in the box.

7
PROBLEM ANALYSIS:

There are three tables created in this application.

 Name: This table will collect the names of the user,

 Highscores : It consists of Users’ names with their highest WPM


for a given paragraph.

 Paragraphs: This table consists of random paragraphs with


different difficulties level.

HARDWARE AND SOFTWARE REQUIREMENTS:


8
# Hardware:

 Monitor, Keyboard, Mouse.

 Computer with RAM of at least 1 GB.

 System Type: At least 32 bit operating system.

# Software:

 Windows (7/8/10) or Linux.

 Programming Language: Python 3.7 or Later.

SCOPE FOR FUTURE ENHANCEMENT :

9
Enables You to Focus on Your Ideas:

Hunt and peck typing takes a lot more thought and attention than touch
typing.

In fact, touch typists don’t even need to think about where the keys are
for a second. The muscle memory in their fingers helps them type with
ease.

This means that touch typists can put all of their thought and attention on
the work at hand. Whether it’s writing an email, rap lyrics, or an
important memo, mastering typing means you can spend your mental
energy where it’s most needed.

Helps You Communicate More Efficiently:

One thing kids love to do? Chat with their friends. And increasingly,
digital communication is becoming a huge part of how students
communicate.

Communicating with your friends in real time requires getting your


fingers moving while keeping accuracy up.

Makes it Easier to Take Notes:


10
It’s becoming more and more common for students to take notes on
computers in college and even high school. And it makes sense. A
proficient typist can record down ideas much faster than she can write
by hand.

Being quick on the keyboard means you’ll be able to keep up with a


fast-talking professor and ace your next exam.

Prepares You for Your Future Career:

Almost all top professions today require typing competency. From


medicine to law and from fashion design to business, typing is a regular
part of the job.

Working on your WPM will ensure that when you land your dream job
your slow typing skills won’t hold you back from meeting your full
potential.

Helps You Land the Job:

Before you can rock at your dream job, though, you have to land it. And
tough but true, how one types is often seen as an indicator of
intelligence.

11
If your resume is riddled with careless typing errors, or if the process of
writing an email is a laborious task, chances are you won’t get hired in
the first place.

12
SOURCE CODE:

import cursor
from cursor import wrapper
import time
import random

def start_screen(stdscr):
stdscr.clear()
stdscr.addstr("Welcome to the Speed Typing Test!")
stdscr.addstr("\nPress any key to begin!")
stdscr.refresh()
stdscr.getkey()

def display_text(stdscr, target, current, wpm=0):


stdscr.addstr(target)
stdscr.addstr(1, 0, f"WPM: {wpm}")

for i, char in enumerate(current):


correct_char = target[i]
color = curses.color_pair(1)
if char != correct_char:
color = curses.color_pair(2)

stdscr.addstr(0, i, char, color)

def load_text():
with open("text.txt", "r") as f:
lines = f.readlines()

13
return random.choice(lines).strip()

def wpm_test(stdscr):
target_text = load_text()
current_text = []
wpm = 0
start_time = time.time()
stdscr.nodelay(True)

while True:
time_elapsed = max(time.time() - start_time, 1)
wpm = round((len(current_text) / (time_elapsed / 60)) /
5)

stdscr.clear()
display_text(stdscr, target_text, current_text, wpm)
stdscr.refresh()

if "".join(current_text) == target_text:
stdscr.nodelay(False)
break

try:
key = stdscr.getkey()
except:
continue

if ord(key) == 27:
break

14
if key in ("KEY_BACKSPACE", '\b', "\x7f"):
if len(current_text) > 0:
current_text.pop()
elif len(current_text) < len(target_text):
current_text.append(key)

def main(stdscr):
curses.init_pair(1, curses.COLOR_GREEN,
curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_RED,
curses.COLOR_BLACK)
curses.init_pair(3, curses.COLOR_WHITE,
curses.COLOR_BLACK)

start_screen(stdscr)
while True:
wpm_test(stdscr)
stdscr.addstr(2, 0, "You completed the text! Press any
key to continue...")
key = stdscr.getkey()

if ord(key) == 27:
break

wrapper(main)

OUTPUT:
15
16
17
18
19
20
BIBLIOGRAPHY:

 SUMITA ARORA – CLASS 11 AND 12


COMPUTER SCIENCE TEXTBOOK

21

You might also like