Grade XI CS Project Report-Varun
Grade XI CS Project Report-Varun
On
“Stop watch”
Submitted By
XI
Mr.kripal singh
This is to certify that the project work “stop watch” is a bonafide record of work done by
Mr.Varun Thakur and Akshay Dhiman under my guidance and supervision.
Kripal singh
2
ACKNOWLEDGMENT
I am extremely grateful to Mr. Kripal singh, Teacher of Department of cs for her able
guidance and useful suggestions, which helped me in completing the project work, in
time.
My sincere thanks goes to MS. Girish chand, our beloved Principal Mam, for her extended
support for the completion of this project
I would also like to thank all the teaching and non-teaching staff of cs department who
helped me directly or indirectly in the completion of this project.
Finally, yet importantly, I would like to express my heartfelt thanks to my beloved parents
for their blessings, my friends/classmates for their help and wishes for the successful
completion of this project.
3
TABLE OF CONTENTS
INTRODUCTION……………………………………………….………………… 5
SOURCE CODE…………………………………………………..……………….. 7
OUTPUT SCREEN………………………………………..……………………….. 10
4
INTRODUCTION
The project is on stop watch. The title of the project is “stop watch”. In this project we
stop and start the time by pressing enter and then press enter again to stop the time . To
reset the time we simply type reset .
1. time
Purpose: To track the time for starting, stopping, and calculating elapsed time.
Functions Used:
5
time.time(): Returns the current time in seconds since the epoch.
2. os (Optional)
Purpose: To clear the screen for better display during stopwatch execution in the terminal.
3. datetime (Optional)
Functions Used:
datetime.timedelta: Converts seconds into a human-readable format (e.g., hours, minutes, seconds).
6
4. sys (Optional)
Purpose: To handle smooth program exits if the user terminates the stopwatch prematurely.
Functions Used:
SOURCE CODE
import time
7
def stopwatch():
print("Stopwatch Application")
start_time = None
elapsed_time = 0
while True:
if user_input == "":
if start_time is None:
start_time = time.time()
print("Stopwatch started.")
else:
start_time = None
8
# Reset the stopwatch
start_time = None
elapsed_time = 0
break
else:
stopwatch()
9
OUTPUT SCREEN
Interface
10
taking some time
11
Reseting the time
12
Result
13
14