Professional Documents
Culture Documents
SESSION 2023-2024
CS PROJECT FILE SESSION 2023-2024 CLASS-12
AYUSH JHA
SP SHARMA SIR
B
Teacher’s Signature
External Invigilator’s Signature
SACHIN SIR
CS PROJECT FILE SESSION 2023-2024 CLASS-12
PGT CS/IP
CS PROJECT FILE SESSION 2023-2024 CLASS-12
4 GSBV,BURARI AYUSH
Kumar
CS PROJECT FILE SESSION 2023-2024 CLASS-12
ACKNOWLEDGEMENT
Apart from the efforts of me, the success of any project depends
largely on the encouragement and guidelines of many others. I take
this opportunity to express my gratitude to the people who have
been instrumental in the successful completion of this project.
The guidance and support received from all the members who
contributed and who are contributing to this project, was vital for
the success of the project. I am grateful for their c constant support
and help
4 GSBV,BURARI AYUSH
Kumar
CS PROJECT FILE SESSION 2023-2024 CLASS-12
7
GSBV, BURARI
AYUSH
# OBJECTIVE
The objective of this project is to give shopkeeper an
effective way to keep account of the person who has
buy product without giving money or giving fewer
amounts then the actual price
They can also see name of all person who had bought
something without giving money easily.
8
GSBV, BURARI
AYUSH
System Requirements of the Project
9
GSBV, BURARI
AYUSH
# Python Code
import mysql.connector
import datetime
import time
def adduser(a):
q="CREATE TABLE "+a+"(Date date,money_taken
int,money_returned int)"
cursor.execute(q)
mydb.commit()
def adduserstr(a):
if type(a)==str:
adduser(a)
def addentry(a,b):
date=datetime.date.today()
q="INSERT INTO "+a+"(Date,money_taken)VALUES(%s,%s)"
cursor.execute(q,(date,b))
mydb.commit()
def addnegentry(a,b):
date=datetime.date.today()
q="INSERT INTO "+a+"(Date,money_returned)VALUES(%s,%s)"
cursor.execute(q,(date,b))
mydb.commit()
def greet():
print("Your data has been updated")
x=0
for i in range(3):
username=input("Enter the user name of mysql:")
password=input("Enter the password of mysql:")
x=i+1
try:
mydb=mysql.connector.connect(host='localhost',user=username,passwd
10
GSBV, BURARI
AYUSH
=password)
except mysql.connector.errors.ProgrammingError:
print("User name or Password is wrong")
print("try again")
print(i+1)
if i==2:
print("Something went wrong")
print("try again later")
break
continue
else:
break
if x<3:
if mydb.is_connected():
print("Connected to MySQL Server version \n")
time.sleep(.5)
cursor=mydb.cursor()
cursor.execute("show databases")
databases=[]
for i in cursor:
databases.append(i[0])
d="khata"
if d in databases:
cursor.execute("use khata")
elif d not in databases:
cursor.execute("create database khata")
cursor.execute("use khata")
while mydb.is_connected:
all_user=[]
cursor.execute("show tables")
for i in cursor:
all_user.append(i[0])
print()
print("-type 1 to show name of all debtor")
11
GSBV, BURARI
AYUSH
CS PROJECT FILE SESSION 2023-2024 CLASS-12
greet ()
12 GSBV,BURARI AYUSH
Kumar
CS PROJECT FILE SESSION 2023-2024 CLASS-12
else:
print(a,"doesn’t exist")
elif choice==4:
a=input("Enter the name of debtor who's debt you want to
know:")
if a in all_user:
total=0
q="SELECT SUM(money_taken) FROM "+a
cursor.execute(q)
for i in cursor:
total=total+int(i[0])
p="SELECT SUM(money_returned) FROM "+a
cursor.execute(p)
for i in cursor:
total=total-int(i[0])
print("Total amount of money=",total)
else:
print(a,"doesn’t exist")
elif choice==5:
a=input("Enter the name of debtor who's data is to update :")
if a in all_user:
b=input("Enter the amount of money:")
addnegentry(a,b)
greet()
else:
print(a,"doesn’t exist")
elif choice==6:
a=input("Enter the name of debtor who's data is to be
delete:")
if a in all_user:
print("Are you sure you want to delete all data of ",a)
print("y/n")
b=input()
while True:
13 GSBV,BURARI AYUSH
Kumar
CS PROJECT FILE SESSION 2023-2024 CLASS-12
if b=="y" or b=="Y":
q="drop table "+a
cursor.execute(q)
mydb.commit()
greet()
break
elif b=="n" or b=="N":
break
else:
print("type y or n")
continue
else:
print(a,"doesn’t exist")
elif choice==7:
a=input("Enter the name of debtor who's data you want to
know:")
if a in all_user:
q="SELECT * FROM "+a
cursor.execute(q)
print("Date |Money Taken |Money Returned")
for i in cursor:
print(i[0],"|",i[1],"|",i[2])
mydb.commit()
else:
print(a,"doesn’t exist")
print()
elif(choice==8):
print("BYE")
time.sleep(.6)
break
14 GSBV,BURARI AYUSH
Kumar
CS PROJECT FILE SESSION 2023-2024 CLASS-12
else:
print("type a number from above ")
time.sleep(.5)
print("Came again later")
time.sleep(.5)
15 GSBV,BURARI AYUSH
Kumar
CS PROJECT FILE SESSION 2023-2024 CLASS-12
Output
Python 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC
v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more
information.
========== RESTART:
C:\Users\times\OneDrive\Documents\project\khata.py =========
Enter the user name of mysql:root
Enter the password of mysql:aksh
Connected to MySQL Server version
V
-type 1 to show name of all debtor
-type 2 to add a new debtor
-type 3 to add a new entry in old debtor
-type 4 to show total debt of old debtor
-type 5 to add a negative entry
-type 6 to delete a old debtor
-type 7 to know all data of a debtor
-type 8 to exit
17 GSBV,BURARI
AYUSH
-type 4 to show total debt of old debtor
-type 5 to add a negative entry
-type 6 to delete old debtor
-type 7 to know all data of a debtor
-type 8 to exit
18 GSBV,BURARI AYUSH
Kumar
Enter your choice:7
Enter the name of debtor who's data you want to know: aksh
Date |Money Taken |Money Returned
2022-03-03 | 4000 | None
2022-03-03 | None | 2000
2022-03-03 | 3000 | None
2022-03-03 | None | 2000
19 GSBV,BURARI AYUSH
Kumar
Enter your choice: 5
Enter the name of debtor who's data is to update: 3000
3000 doesn’t exist
20 GSBV,BURARI AYUSH
Kumar
-type 1 to show name of all debtor
-type 2 to add a new debtor
-type 3 to add a new entry in old debtor
-type 4 to show total debt of old debtor
-type 5 to add a negative entry
-type 6 to delete old debtor
-type 7 to know all data of a debtor
-type 8 to exit
21 GSBV,BURARI AYUSH
Kumar
-type 1 to show name of all debtor
-type 2 to add a new debtor
-type 3 to add a new entry in old debtor
-type 4 to show total debt of old debtor
-type 5 to add a negative entry
-type 6 to delete old debtor
-type 7 to know all data of a debtor
-type 8 to exit
22 GSBV,BURARI AYUSH
Kumar
Database
| performance_schema |
| sakila |
| sys |
| world |
+ -+
9 rows in set (0.00 sec)
22 GSBV,BURARI AYUSH
Kumar
CS PROJECT FILE SESSION 2023-2024 CLASS-12
mysql> use
khata;
Database
changed
mysql> show
tables;
+ -+
| Tables_in_khata |
+ -+
| aniket |
| priyansh |
+ -+
2 rows in set (0.00
sec) mysql> select
* from aniket;
+ + + +
| Date | money_taken | money_returned |
+ + + +
| 2022-03-03 | 7000 | NULL |
| 2022-03-03 | 3000 | NULL |
+ + +
+ 2 rows in set
(0.00 sec)
25 GSBV,BURARI AYUSH
Kumar
CS PROJECT FILE SESSION 2023-2024 CLASS-12
25 GSBV,BURARI AYUSH
Kumar
CS PROJECT FILE SESSION 2023-2024 CLASS-12
TESTING
Software Testing is an empirical investigation conducted to provide
With Information about the quality of the product or service under
test stakeholders a with respect to the context which it is intended to
operate. Software Testing also provides an objective, independent
view of the software to allow the business to appreciate and
understand the risks at implementation of the software. Test
techniques include, but are not limited to, the process of executing a
program or application with the intent of finding software bugs. It
can also be stated as the process of validating and verifying that a
software program/application/product meets the business and
technical requirements that guided its design and development, so
that it works as expected and can be implemented with the same
characteristics. Software Testing, depending on the testing method
employed, can be implemented at any time in the development
process, however the most test effort is employed after the
requirements have been defined and coding process has been
completed.
TESTING METHODS
Software testing methods are traditionally divided into black box
testing. These one approaches are used to describe the point of view
that a test engineer takes when designing test cases.
26 GSBV,BURARI AYUSH
1
CS PROJECT FILE SESSION 2023-2024 CLASS-12
SPECIFICATION-BASED TESTING
Specification-based testing aims to test the functionality of software
according to the applicable requirements. Thus, the tester inputs
data into, and only sees the output from the test object. This level of
testing usually requires through test cases to be provided to the
tester, who they test that for a given input. The output value (or
behaviour), either RUUPE value specified in the test case.
Specification-based testing is necessary, but it is insufficient to guard
against certain risks.
27 GSBV,BURARI AYUSH
2
CS PROJECT FILE SESSION 2023-2024 CLASS-12
1. python.org
2. S P SHARMA CLASSES App and Website
3. YouTube
4. Our Subject Teacher S P Sharma Sir
5. Preeti Arora and Sumita Arora python class
12 Book
6. LearnPython.org
7. Google
28 GSBV,BURARI AYUSH