0% found this document useful (0 votes)
7 views14 pages

Grade XI CS Project Report-Varun

The project report details the development of a stopwatch application created by Varun Thakur and Akshay Dhiman under the guidance of Mr. Kripal Singh. It includes an introduction to the project, header files used, source code, and output screens demonstrating the application's functionality. The report also acknowledges the support of faculty and family in completing the project.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views14 pages

Grade XI CS Project Report-Varun

The project report details the development of a stopwatch application created by Varun Thakur and Akshay Dhiman under the guidance of Mr. Kripal Singh. It includes an introduction to the project, header files used, source code, and output screens demonstrating the application's functionality. The report also acknowledges the support of faculty and family in completing the project.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Project Report

On

“Stop watch”

Submitted By

Varun thakur and Akshay dhiman

XI

Under the guidance of

Mr.kripal singh

PGT (Computer Science)

Department of cs,kendriya vidyalaya bangana


CERTIFICATE

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

Kendriya Vidyalaya Bangana

Sign of Guide: __________________ Principal’s Signature:___________________

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

HEADER FILES USED…………………………………………………………… 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 .

This project will display the time at which we stop it.

HEADER FILES USED

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.

time.sleep(): Pauses execution for a specified number of seconds (optional, if required).

2. os (Optional)

Purpose: To clear the screen for better display during stopwatch execution in the terminal.

Function Used:os.system('cls') for Windows or os.system('clear') for Unix/Linux.

3. datetime (Optional)

Purpose: To format and display the elapsed time in a user-friendly way.

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:

sys.exit(): Exits the program safely.

SOURCE CODE

import time

7
def stopwatch():

print("Stopwatch Application")

print("Press 'Enter' to start the stopwatch.")

print("Press 'Enter' again to stop it.")

print("Type 'reset' to reset the timer.")

print("Type 'exit' to quit the application.")

start_time = None

elapsed_time = 0

while True:

user_input = input("\nEnter command: ").strip().lower()

if user_input == "":

if start_time is None:

# Start the stopwatch

start_time = time.time()

print("Stopwatch started.")

else:

# Stop the stopwatch

elapsed_time += time.time() - start_time

start_time = None

print(f"Stopwatch stopped. Elapsed time: {elapsed_time:.2f} seconds.")

elif user_input == "reset":

8
# Reset the stopwatch

start_time = None

elapsed_time = 0

print("Stopwatch reset to 0 seconds.")

elif user_input == "exit":

# Exit the application

print("Exiting stopwatch. Goodbye!")

break

else:

print("Invalid command. Press 'Enter' to start/stop, 'reset' to reset, or 'exit' to


quit.")

# Run the stopwatch

stopwatch()

9
OUTPUT SCREEN

Interface

10
taking some time

11
Reseting the time

12
Result

13
14

You might also like