Ayush
Ayush
1 PATNA
PRACTICAL
FILE
SESSION: 2020-21
CLASS -XII
INFORMATICS PRACTICES
(PYTHON)
1
CERTIFICATE
This is to certify that project report entitled
INVESTIGATORY WORK (LOC)List Of Candidates has
been successfully completed by Ayush Kumar Dubey is
being submitted for Practical Examination Of Class
12(CBSE 2020-2021) in Informatics Practices.
Examiner’s signature
2
ACKNOWLEDGEMENT
I would like to express my special thanks of
gratitude to my teacher Mr.MANOJ KUMAR,who
gave me the golden opportunity to do this
wonderful project INVESTIGATORY WORK
(LOC)List Of Candidates. This also helped me in
doing a lot of research and I came to know about
so many new things.
Secondly, I would also like to thanks my parents
and friends, who helped me a lot in finishing this
project within stipulated time. I am making this
project not only for marks but to increase my
knowledge.
-Ayush Kumar Dubey XII ‘‘C”
3
INDEX
Sl.no. Topic
1 System requirements
2 Errors and its types
3 Testing
4 Maintenance
5 Flow chart of program
6 Source Code
7 Output
8 Bibliography
4
SYSTEM REQUIREMENTS
Operating System:
• Windows 10
Minimum Hardware and Software:
• x86 64-bitCPU(Intel/ADMarchitecture)
• 4 GB RAM
• 5 GB free disk space
Front End:
• Python 3.5.8
Back End:
• My SQL Server 8.0
5
ERRORS AND ITS TYPES
An error, some time called “A BUG” is anything in the code
that prevents a program from compiling and running
correctly. There are broadly three types of errors as follows:
1. Compile-time errors: Errors that occurs during
compilation of a program is called compile time error. It
has two types as follows:
a. Syntax error: It refers to formal rules governing the
construction of valid statements in a language.
b. Semantics error: It refers to the set of rules which
give the meaning of a statement.
2. Run time Errors: Errors that occur during the execution
of program are run time errors. These are harder to detect
errors. Some run-time error stop the execution of
program which is then called program “Crashed”.
3. Logical Errors: Sometimes, even if you don’t encounter
any error during compiling-time and runtime, your
program does not provide the correct result. This is
because of the programmer’s mistaken analysis of the
problem he or she is trying to solve. Such errors are called
logical error.
6
TESTING
1. Alpha Testing: It is the most common type of testing used
in the software industry. The objective of this testing is to
identify all possible issues or defects before releasing it
into the market or to the user. It is conducted at the
developer’s site.
2. Beta Testing: It is a formal type of software testing which
is carried out by the customers. It is performed in a real
environment before releasing the products into the
market for the actual end-users. It is carried out to ensure
that there are no major failures in the software or product
and it satisfies the business requirement. Beta Testing is
successful when the customer accepts the software.
3. White Box Testing: White box testing is based on the
knowledge about the internal logic of an application’s
code. It is also known as Glass box Testing. Internal
Software and code working should be known for
performing this type of testing. These tests are based on
the coverage of the code statements, branches, paths,
conditions etc.
4. Black Box Testing: It is a software testing, method in
which the internal structure or design of the item to be
tested is not known to the tester. This method of testing
can be applied virtually to every level of the software
testing.
7
MAINTENANCE
Programming maintenance refers to the modifications in
the program. After it has been completed, in order to meet
changing requirement or to take care of the errors that
shown up. There are four types of maintenance:
1. Corrective Maintenance: When the program after
compilation shows error because of some unexpected
situations, untested areas such errors are fixed up by
Corrective maintenance.
2. Adaptive Maintenance: Changes in the environment in
which an information system operates may lead to system
management. To accommodate changing needs time to
time maintenance is done and is called Adaptive
maintenance.
3. Preventive Maintenance: If possible the errors could be
anticipated before they actually occur; the maintenance is
called Preventive maintenance.
4. Perfective Maintenance: In this rapidly changing world,
information technology is the fastest growing area. If the
existing system is maintained to keep tuned with the new
features, new facilities, new capabilities, it is said to be
Perfective maintenance.
8
FLOW CHART OF THE
PROGRAM
LIST OF CANDIDATES
EXIT
9
CODING
import mysql.connector as mycon
import sys
con=mycon.connect(host="localhost",port="3306",user="root",passw
ord="ayush",database="loc")
mycursor=con.cursor()
if con.is_connected():
print("connected successfully")
#-----------------------*TABLE CREATION*------------------------
#---------------------------*CHOICES*---------------------------
while(True):
print("input 'I' for insertion of a record")
print("input 'U' for update an existing record")
print("input 'R' for removing an existing record")
print("input 'S' for searching a record")
print("input 'D' for displaying all records")
print("input 'E' to exit the program")
10
ch=input("enter your option:")
#-------------------------*INSERTION*---------------------------
if ch=='I' or ch=='i':
print("insertion operation")
reg=int(input("enter student's
registeration_num:"))
locsr=int(input("enter student's loc_sr_num:"))
yrpassc11=int(input("enter student's
year_passing_class11:"))
ecat=input("enter student's exam_cat:")
sname=input("enter student's name:")
mname=input("enter students mother's name:")
fname=input("enter students father's name:")
gender=input("enter student's gender:")
cat=input("enter student's category:")
minor=input("enter if student belongs to minority
section(y/n):")
pwdis=input("enter if student have disability(type of
disability):")
mnum=int(input("enter student's mobile_num:"))
email=input("enter student's email_id:")
ad_num=int(input("enter student's addhar_num:"))
s1=input("enter subject1(compulsory language):")
s2=input("enter subject2:")
s3=input("enter subject3:")
s4=input("enter subject4:")
s5=input("enter subject5:")
s6=input("enter subject6(additional):")
intsub1=input("enter name of internal grade
subject1:")
intsub2=input("enter name of internal grade
subject2:")
intsub3=input("enter name of internal grade
subject3:")
aninc=int(input("enter annual income of student's parents:"))
eexrnum=int(input("enter student's rollnum of equivalent exam
passed:"))
eexam=input("enter student's exam of equivalent exam passed:")
eexboard=input("enter student's board of equivalent exam
passed:")
sch=input("enter if student is single child or
not:")
mgcr=input("enter if migration certificate is required or not:")
adm_num=int(input("enter student's admission num:"))
11
adm_date=input("enter student's admission date:")
q="insert into
students_info(reg_num,loc_sr_num,yr_pass_xi,exam_cat,cand_name,m
other_name,father_name,gender,category,minority,PwD_status,mob_n
um,email_id,aadhar_num,sub_1,\
sub_2,sub_3,sub_4,sub_5,add_sub_6,int_grade_sub1,int_grade_sub2,
int_grade_sub3,annual_income,roll_num_of_equi_exam_passed,exam_o
f_equi_exam_passed,board_of_equi_exam_passed,\
single_child,migration_certificate,adm_no,adm_date)values({},{},
{},'{}','{}','{}','{}','{}','{}','{}','{}',{},'{}',{},'{}','{}',
'{}','{}','{}','{}','{}','{}','{}',{},\
{},'{}','{}','{}','{}',{},'{}')\
".format(reg,locsr,yrpassc11,ecat,sname,mname,fname,gender,cat,m
inor,pwdis,mnum,email,ad_num,s1,s2,s3,s4,s5,s6,intsub1,intsub2,i
ntsub3,aninc,eexrnum,eexam,eexboard,sch,\
mgcr,adm_num,adm_date)
mycursor.execute(q)
con.commit()
print("record is inserted successfully")
#--------------------------*UPDATION*---------------------------
elifch=='U' or ch=='u':
print("Updation of record")
reg=input("enter student's registration number:")
sn=input("enter new student's name:")
mn=input("enter new student mother's name:")
fn=input("enter new student father's name:")
e_id=input("enter new student's email id:")
qry="update students_info set
cand_name='{}',mother_name='{}',father_name='{}',email_id='{}'
where reg_num={}".format(sn,mn,fn,e_id,reg)
mycursor.execute(qry)
con.commit()
print("Record is updated successfully")
#-----------------------------*REMOVAL*-------------------------
elifch=='R' or ch=='r':
print("Removal of record")
reg=input("enter student's registration number:")
12
qry="delete from students_info where reg_num={}".format(reg)
mycursor.execute(qry)
con.commit()
print("record is deleted successfully")
#---------------------------*SEARCHING*-------------------------
elifch=='S' or ch=='s':
print("searching operation")
reg=input("enter student's registeration number:")
qry="select * from students_info where reg_num={}".format(reg)
mycursor.execute(qry)
data=mycursor.fetchone()
count=mycursor.rowcount
print("total no of records :",count)
for row in data:
print(row)
print("record is found successfully")
#---------------------------*DISPLAY*---------------------------
elifch=='D'or ch=='d':
print("display all records")
qry="select * from students_info"
mycursor.execute(qry)
data=mycursor.fetchall()
count=mycursor.rowcount
print("total no of records:",count)
print("{0:<9s{1:<9s}
print("{0:< 20s} {1:< 20s} {2:< 20s}
{3:< 20s} {
{4:< 20s} {4:<9s}{5:<9s}
{5:< 20s} {6:< 20s}
{7:< 20s} {7:<9s
{8:< 20s}{8:<9s}
{9:< 20s}".\
format('Sl.No','Name','MName','FName','Subject1','Subject2','Sub
ject3','Subject4','Subject5','Subject6'))
print("_________________________________________________________
________________________________________________________________
__________________________")
13
format(str(row[1]),row[4],row[5],row[6],row[14],row[15],row[16],
row[17],row[18],row[19]))
print()
print("*********************************************************
****************************************************************
*************************")
#-------------------------*EXITING*-----------------------------
elifch=='E' or ch=='e':
print("exiting program")
sys.exit(0)
else:
print("wrong input.Try again!!!")
else:
print("Mysql Database connection failed. Terminating…...¦.")
14
OUTPUT
15
-table student_info described
16
17
-insertion of data
18
-data inserted in MYSQL database
-updation of record
19
-data in MYSQL after updation
20
-data in MYSQL after removal of an record
21
-searching of exesting record
22
-displaying all records
23
Bibliography
• Computer Science Class 12 By Sumitra Arora
• Computer Science Class 12 By Priti Arora
• https:/stackoverflow.com/ (For error resolving)
• Google Images
24