0% found this document useful (0 votes)
752 views

Project Report On Employee Management System

This document is a project report for an Employee Management System created by a student named Vishal Kumar for their Class XII Computer Science course. It includes sections on objectives, proposed system features, system development lifecycle phases, flowcharts, source code, outputs, installation files, testing, and hardware/software requirements. The project was created under the guidance of teacher Mrs. Asha AC and will be demonstrated for a practical examination.

Uploaded by

private69raghav
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
752 views

Project Report On Employee Management System

This document is a project report for an Employee Management System created by a student named Vishal Kumar for their Class XII Computer Science course. It includes sections on objectives, proposed system features, system development lifecycle phases, flowcharts, source code, outputs, installation files, testing, and hardware/software requirements. The project was created under the guidance of teacher Mrs. Asha AC and will be demonstrated for a practical examination.

Uploaded by

private69raghav
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 58

VSS INTERNATIONAL PUBLIC SCHOOL

ACADEMIC YEAR : 2022-23

PROJECT REPORT ON

EMPLOYEE MANAGEMENT SYSTEM

ROLL NO :

NAME :

CLASS : XII

SUBJECT : COMPUTER SCIENCE

SUB CODE : 083

PROJECT GUIDE: Mrs Asha AC

PGT (CS)

VSS INTERNATIONAL PUBLIC SCHOOL

#78, ORR, NAGADEVANAHALLI,


BENGALURU - 56

1
VSS INTERNATIONAL PUBLIC SCHOOL

CERTIFICATE

This is to certify that Cadet VISHAL KUMAR CBSE Roll

No:_________________ has successfully completed the project Work entitled

EMPLOYEE MANAGEMENT SYSTEM in the subject Computer Science (083) laid

down in the regulations of CBSE for the purpose of Practical Examination in

Class XII to be held in VSS INTERNATIONAL PUBLIC SCHOOL

on______________.

(Mrs ASHA AC)


PGT Comp Sci
Master IC

Signature of External Examiner

Name: _______________________

Examiner Number:_______________

2
TABLE OF CONTENTS [ T O C ]

SER DESCRIPTION PAGE NO

01 ACKNOWLEDGEMENT 04

02 INTRODUCTION 05

03 OBJECTIVES OF THE PROJECT 05

04 PROPOSED SYSTEM 06

05 SYSTEM DEVELOPMENT LIFE CYCLE (SDLC) 07

06 PHASES OF SYSTEM DEVELOPMENT LIFE CYCLE 08

07 FLOW CHART 15

08 SOURCE CODE 16

09
OUTPUT 51

10 INSTALLATION FILE 53

10 TESTING 55

11 HARDWARE AND SOFTWARE REQUIREMENTS 58

12 BIBLIOGRAPHY 58

3
ACKNOWLEDGEMENT

My sincere efforts have made me to accomplish the task

of completing this project. However, it would not have

been possible without the kind support and help of many

individuals. I would like to express my sincere gratitude

to my Principal Mrs. Ishrath Jabeen and the school for

providing me with facilities required to do my project. I

am highly indebted to my subject teacher Mrs. Asha AC

for her valuable guidance which has promoted my

efforts in all the stages of this project work. My thanks

and appreciation go to my classmates and laboratory.

Finally, words are not sufficient to express gratitude to

my cherished family members for supporting me without

their encouragement and support I would have not

reached this stage.

4
PROJECT ON EMPLOYEE MANAGEMENT SYSTEM

INTRODUCTION

This project is all about software for Employee management system. It helps

to have a full-fledged control over his/her employees. The project is divided into 2

sections to make the programme easy to understand.

It receives user name and password to log in and register .It keeps the record

of user salary ,his department of working. It adds a new employee, updates an

existing employee, removes employee, searches and displays employee information.

OBJECTIVES OF THE PROJECT

The objective of this project is to let the students apply the programming

knowledge into a real- world situation/problem and exposed the students how

programming skills helps in developing a good software.

1. Write programs utilizing modern software tools.

2. Apply object oriented programming principles effectively when developing

small to medium sized projects.

3. Write effective procedural code to solve small to medium sized problems.

4. Students will demonstrate a breadth of knowledge in computer science, as

exemplified in the areas of systems, theory and software development.

5. Students will demonstrate ability to conduct a research or applied Computer

Science project, requiring writing and presentation skills which exemplify

scholarly style in computer science.

5
PROPOSED SYSTEM

Today one cannot afford to rely on the fallible human beings of be really

wants to stand against today’s merciless competition where not to wise saying “to

err is human” no longer valid, it’s outdated to rationalize your mistake. So, to keep

pace with time, to bring about the best result without malfunctioning and greater

efficiency so to replace the unending heaps of flies with a much sophisticated hard

disk of the computer.

One has to use the data management software. Software has been an ascent

in atomization various organisations. Many software products working are now in

markets, which have helped in making the organizations work easier and efficiently.

Data management initially had to maintain a lot of ledgers and a lot of paper work

has to be done but now software product on this organization has made their work

faster and easier. Now only this software has to be loaded on the computer and work

can be done.

This prevents a lot of time and money. The work becomes fully automated

and any information regarding the organization can be obtained by clicking the

button. Moreover, now it’s an age of computers of and automating such an

organization gives the better look.

6
SYSTEM DEVELOPMENT LIFE CYCLE (SDLC)

The systems development life cycle is a project management technique that


divides complex projects into smaller, more easily managed segments or phases.
Segmenting projects allows managers to verify the successful completion of project
phases before allocating resources to subsequent phases.
Software development projects typically include initiation, planning, design,
development, testing, implementation, and maintenance phases. However, the
phases may be divided differently depending on the organization involved.
For example, initial project activities might be designated as request,
requirements-definition, and planning phases, or initiation, concept-development,
and planning phases. End users of the system under development should be
involved in reviewing the output of each phase to ensure the system is being built to
deliver the needed functionality.

7
PHASES OF SYSTEM DEVELOPMENT LIFE CYCLE

INITIATION PHASE

The Initiation Phase begins when a business sponsor identifies a need or an


opportunity.

The purpose of the Initiation Phase is to:

Identify and validate an opportunity to improve business accomplishments of


the organization or a deficiency related to a business need.
Identify significant assumptions and constraints on solutions to that need.
Recommend the exploration of alternative concepts and methods to satisfy
the need including questioning the need for technology, i.e., will a change in
the business process offer a solution?
Assure executive business and executive technical sponsorship. The Sponsor
designates a Project Manager and the business need is documented in a
Concept Proposal. The Concept Proposal includes information about the
business process andthe relationship to the Agency/Organization.
Infrastructure and the Strategic Plan. A successful Concept Proposal results
in a Project Management Charter which outlines the authority of the project
manager to begin the project.

Careful oversight is required to ensure projects support strategic business


objectives and resources are effectively implemented into an organization's
enterprise architecture. The initiation phase begins when an opportunity to add,
improve, or correct a system is identified and formally requested through the
presentation of a business case. The business case should, at a minimum, describe
a proposal’s purpose, identify expected benefits, and explain how the proposed
system supports one of the organization’s business strategies. The business case
should also identify alternative solutions and detail as many informational, functional,
and network requirements as possible.

8
SYSTEM CONCEPT DEVELOPMENT PHASE

The System Concept Development Phase begins after a business need or


opportunity is validated by the Agency/Organization Program Leadership and the
Agency/Organization CIO.

The purpose of the System Concept Development Phase is to:

Determine the feasibility and appropriateness of the alternatives.


Identify system interfaces.
Identify basic functional and data requirements to satisfy the business need.
Establish system boundaries; identify goals, objectives, critical success
factors, and performance measures.
Evaluate costs and benefits of alternative approaches to satisfy the basic
functional requirements
Assess project risks
Identify and initiate risk mitigation actions, andDevelop high-level technical
architecture, process models, data models, and a concept of operations. This
phase explores potential technical solutions within the context of the business
need.
It may include several trade-off decisions such as the decision to use COTS
software products as opposed to developing custom software or reusing
software components, or the decision to use an incremental delivery versus a
complete, onetime deployment.
Construction of executable prototypes is encouraged to evaluate technology
to support the business process. The System Boundary Document serves as
an important reference document to support the Information Technology
Project Request (ITPR) process.
The ITPR must be approved by the State CIO before the project can move
forward.

9
PICTORIAL REPRESENTATION OF SDLC:

PLANNING PHASE

The planning phase is the most critical step in completing development,


acquisition, and maintenance projects. Careful planning, particularly in the early
stages of a project, is necessary to coordinate activities and manage project risks
effectively. The depth and formality of project plans should be commensurate with
the characteristics and risks of a given project. Project plans refine the information
gathered during the initiation phase by further identifying the specific activities and
resources required to complete a project.
During this phase, a plan is developed that documents the approach to be
used and includes a discussion of methods, tools, tasks, resources, project
schedules, and user input. Personnel assignments, costs, project schedule, and
target dates are established.

10
REQUIREMENTS ANALYSIS PHASE

This phase formally defines the detailed functional user requirements using
high-level requirements identified in the Initiation, System Concept, and Planning
phases. It also delineates the requirements in terms of data, system performance,
security, and maintainability requirements for the system. The requirements are
defined in this phase to a level of detail sufficient for systems design to proceed.
They need to be measurable, testable, and relate to the business need or
opportunity identified in the Initiation Phase. The requirements that will be used to
determine acceptance of the system are captured in the Test and Evaluation
MasterPlan.

The purposes of this phase are to:

Further define and refine the functional and data requirements and document
them in the Requirements Document.
Develop detailed data and process models (system inputs, outputs, and the
process.
Develop the test and evaluation requirements that will be used to determine
acceptable system performance.

DESIGN PHASE

The design phase involves converting the informational, functional, and


network requirements identified during the initiation and planning phases into unified
design specifications that developers use to script programs during the development
phase. Program designs are constructed in various ways. Using a top-down
approach, designers first identify and link major program components and interfaces,
then expand design layouts as they identify and link smaller subsystems and
connections. Using a bottom-up approach, designers first identify and link minor
program components and interfaces, then expand design layouts as they identify
and link larger systems and connections. Contemporary design techniques often use
prototyping tools that build mock-up designs of items such as application screens,
database layouts, and system architectures. End users, designers, developers,

11
database managers, and network administrators should review and refine the
prototyped designs in an iterative process until they agree on an acceptable design.
Audit, security, and quality assurance personnel should be involved in the review
and approval process. During this phase, the system is designed to satisfy the
functional requirements identified in the previous phase. Since problems in the
design phase could be very expensive to solve in the later stage of the software
development, a variety of elements are considered in the design to mitigate risk.
These include:

Identifying potential risks and defining mitigating design features.


Performing a security risk assessment.
Developing a conversion plan to migrate current data to the new system.
Determining the operating environment.
Defining major subsystems and their inputs and outputs.
Allocating processes to resources.
Preparing detailed logic specifications for each software module. The result is
a draft System Design Document which captures the preliminary design for
the system.
Everything requiring user input or approval is documented and reviewed by
the user.

DEVELOPMENT PHASE

The development phase involves converting design specifications into


executable programs. Effective development standards include requirements that
programmers and other project participants discuss design specifications before
programming begins. The procedures help ensure programmers clearly
understand program designs and functional requirements. Programmers use
various techniques to develop computer programs. The large transaction oriented
programs associated with financial institutions have traditionally been developed
using procedural programming techniques. Procedural programming involves the
line-by-line scripting of logical instructions that are combined to form a program.
Effective completion of the previous stages is a key factor in the success of the
Development phase. The Development phase consists of:

12
Translating the detailed requirements and design into system components.
Testing individual elements (units) for usability.
Preparing for integration and testing of the IT system.

INTEGRATION AND TEST PHASE

Subsystem integration, system, security, and user acceptance testing is


conducted during the integration and test phase. The user, with those
responsible for quality assurance, validates that the functional requirements,
as defined in the functional requirements document, are satisfied by the
developed or modified system.
Multiple levels of testing are performed, including:

Testing at the development facility by the contractor and possibly supported


by end users

Testing as a deployed system with end users working together with contract
personnel

Operational testing by the end user alone performing all functions.


Requirements are traced throughout testing a final Independent Verification &
Validation evaluation is performed and all documentation is reviewed and
accepted prior to acceptance of the system.

IMPLEMENTATION PHASE

This phase is initiated after the system has been tested and accepted by the
user. In this phase, the system is installed to support the intended business
functions. System performance is compared to performance objectives established
during the planning phase. Implementation includes user notification, user training,
installation of hardware, installation of software onto production computers, and

13
integration of the system into daily work processes. This phase continues until the
system is operating in production in accordance with the defined user requirement

OPERATIONS AND MAINTENANCE PHASE

The system operation is ongoing. The system is monitored for continued


performance in accordance with user requirements and needed system
modifications are incorporated. Operations continue as long as the system can be
effectively adapted to respond to the organization’s needs. When modifications or
changes are identified, the system may reenter the planning phase.

The purpose of this phase is to:

Operate, maintain, and enhance the system.


Certify that the system can process sensitive information.
Conduct periodic assessments of the system to ensure the functional
requirements continue to be satisfied.
Determine when the system needs to be modernized, replaced, or retired.

14
FLOW CHART

START

LOGIN

ADMIN EMPLOYEE
1.ADD EMPLOYEE 1. PAYSLIP(monthly)
2.UPDATE EMPLOYEE 2. UPDATE EMPLOYEE
3.REMOVE EMPLOYEE
3. PAYSLIP(yearly)
4.SEARCH AND DISPLAY
EMPLOYE DETAILS 4. SEARCH AND DISPLAY

5.DISPLAY ALL EMPLOYEE EMPLOYE DETAILS


DETAILS

STOP 15
SOURCE CODE

================================================================
import mysql.connector as sql
conn=sql.connect(host='localhost',user='root',password='Vssips2022!'
,database='employee')
if conn.is_connected():
print("{:>70}".format("--->>WELCOME TO VSSIPS EMPLOYEE
MANAGEMENT SYSTEM<<---"))
conn.close()
#-----------------------------
emp_login-------------------------------------------
def emp_login():
import mysql.connector as sql

conn=sql.connect(host='localhost',user='root',password='Vssips2022!'
,database='employee')
if conn.is_connected():
print("{:>60}".format("--->>EMPLOYEE LOGIN<<---"))
d=conn.cursor()
u=input("\nENTER YOUR USERNAME\n")
q=(u,)
b=str(u)
sql_tm="select * from employee_details where user_name=%s;"
d.execute(sql_tm,q)
e=d.fetchall()
if e==[]:
print("\nUSERNAME NOT FOUND\nTRY AGAIN\n")
log_in()
else:
p=input("\nENTER YOUR PASSWORD\n")
if p==u+'@2023':
print("{:>60}".format("--->>WELCOME<<---"))
emp_main_menu()
else:
print("\nINCORRECT PASSWORD\nTRY AGAIN\n")
log_in()

#-----------------------------
ad_login-------------------------------------------

def ad_login():
import mysql.connector as sql

conn=sql.connect(host='localhost',user='root',password='Vssips2022!'
,database='employee')
if conn.is_connected():
print("{:>60}".format("--->>ADMIN LOGIN<<---"))
d=conn.cursor()

16
u=input("\nENTER YOUR USERNAME\n")
q=(u,)
sql_tm="select * from employee_details where user_name=%s;"
d.execute(sql_tm,q)
e=d.fetchall()
if e==[]:
print("\nUSERNAME NOT FOUND\nTRY AGAIN\n")
log_in()
else:
p=input("\nENTER YOUR PASSWORD\n")
if p=='admin2023':
print("{:>60}".format("--->>WELCOME<<---"))
ad_main_menu()
else:
print("INCORRECT PASSWORD\nTRY AGAIN\n")
log_in()

#-----------------------------
add_emp-------------------------------------------
def add_emp():
import mysql.connector as sql

con=sql.connect(host='localhost',user='root',password='Vssips2022!',
database='employee')
if con.is_connected():
print("{:>60}".format("--->>EMPLOYEE REGISTRATION<<---"))

c=con.cursor()

emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE EMPLOYEE


ID\n")
while emp_id1.isdigit()==False:
print("\nINVALID FORMAT\nPLEASE TRY AGAIN\n ")
emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE
EMPLOYEE ID\n")
continue
while (len(str(emp_id1))!=3):
print("ENTER 3 DIGITS ONLY\nPLEASE TRY AGAIN\n")
emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE
EMPLOYEE ID\n")
continue
emp_id2=str(emp_id1)
emp_id = "vss_" + emp_id2
emp_id3=(emp_id,)
sql_tm="select * from employee_details where emp_id=%s;"
c.execute(sql_tm,emp_id3)
e=c.fetchall()
if e==[]:
emp_fname1=input("\nENTER YOUR FIRST NAME\n")

17
while emp_fname1.isalpha()==False:
print("\nINVALID FIRST NAME\nNAME SHOULD CONTAIN ONLY
LETTERS\nPLEASE TRY AGAIN\n")
emp_fname1=input("\nENTER YOUR FIRST NAME\n")
continue
emp_fname=emp_fname1.capitalize()
emp_lastname1=input("\nENTER YOUR LAST NAME\n")
while emp_lastname1.isalpha()==False:
print("\nINVALID LAST NAME\nNAME SHOULD CONTAIN ONLY
LETTERS\nPLEASE TRY AGAIN\n")
emp_lastname1=input("\nENTER YOUR LAST NAME\n")
continue
emp_lastname=emp_lastname1.capitalize()
a=str(emp_fname)
b=str(emp_lastname)
emp_name=a+" " + b
#emp-name

designation = input("\nENTER EMPLOYEE DESIGNATION\n")

ph_no = input("\nENTER MOBILE NUMBER\n")


while ph_no.isdigit()==False:
print("\nINVALID MOBILE NUMBER\nPLEASE TRY AGAIN\n")
ph_no = input("\nENTER MOBILE NUMBER\n")
continue
while (len(str(ph_no))!=10):
print("\nENTER 10 DIGITS ONLY\nPLEASE TRY AGAIN\n")
ph_no = input("\nENTER MOBILE NUMBER\n")
continue

emergency_ph_no = input("\nENTER EMERGENCY CONTACT NUMBER\


n")
while emergency_ph_no.isdigit()==False:
print("\nINVALID MOBILE NUMBER\nPLEASE TRY AGAIN\n")
emergency_ph_no = input("\nENTER EMERGENCY CONTACT
NUMBER\n")
continue
while (len(str(emergency_ph_no))!=10):
print("\nENTER 10 DIGITS ONLY\nPLEASE TRY AGAIN\n")
emergency_ph_no = input("\nENTER EMERGENCY CONTACT
NUMBER\n")
continue
while (ph_no==emergency_ph_no):
print("\nPHONE NUMBER CAN'T BE SAME AS EMERGENCY PHONE
NUMBER\n")
emergency_ph_no = input("\nENTER EMERGENCY CONTACT
NUMBER\n")
continue
gender = input("ENTER YOUR GENDER: \n1 for MALE\n2 for
FEMALE \n3 for OTHERS\n")

18
if gender!='1' or gender!='2' or gender!='3':
while gender!='1' and gender!='2' and gender!='3':
print("\nINVALID CHOICE\nPLEASE TRY AGAIN\n")
gender = input("ENTER YOUR GENDER: \n1 for MALE\n2
for FEMALE \n3 for OTHERS\n")
continue
if gender== '1':
gender='MALE'
elif gender=='2':
gender='FEMALE'
else:
gender='OTHERS'

qualification=input("\nENTER YOUR QUALIFICATION\n")

print("PLEASE CHOOSE THE RESPECTIVE CODE NUMBER FOR YOUR


BLOOD GROUP")
print("\n1-->O+ve\n2.-->O-ve\n3.-->A+ve\n4.-->A-ve\n5.--
>B+ve\n6.-->B-ve\n7.-->AB+ve\n8.-->AB-ve\n")
ch=input("\nENTER YOUR CHOICE\n")
if ch!='1' or ch!='2' or ch!='3' or ch!='4' or ch!='5' or
ch!='6' or ch!='7' or ch!='8':
while ch!='1' and ch!='2' and ch!='3' and ch!='4' and
ch!='5' and ch!='6' and ch!='7' and ch!='8':
print("\nINVALID CHOICE\nPLEASE TRY AGAIN\n")
ch = input("\nENTER YOUR CHOICE\n")
continue
if ch=='1':
blood_group='O+ve'
elif ch=='2':
blood_group='O-ve'
elif ch=='3':
blood_group='A+ve'
elif ch=='4':
blood_group='A-ve'
elif ch=='5':
blood_group='B+ve'
elif ch=='6':
blood_group='B-ve'
elif ch=='7':
blood_group='AB+ve'
elif ch=='8':
blood_group='AB-ve'
else:
print("\nINVALID CHOICE\nPLEASE TRY AGAIN\n")

permanent_address=input("\nPLEASE ENTER YOUR PERMANENT


ADDRESS IN NOT MORE THAN 70 CHARACTERS\n")
while (len(str(permanent_address))>70 ):

19
print("\nENTER WITHIN 70 CHARCTERS ONLY\nPLEASE TRY
AGAIN\n")
permanent_address = input("\nPLEASE ENTER YOUR PERMANENT
ADDRESS IN NOT MORE THAN 70 CHARACTERS\n")
continue

mail_id=input("\nENTER YOUR MAIL ID\n")


cm= '@gmail.com'
while cm not in mail_id:
print('\nINVALID FORMAT \nPLEASE TRY AGAIN IN THE FORAMT
GIVEN BELOW\n<...>@gmail.com\n')
mail_id=input("\nENTER YOUR MAIL ID\n")

pan_no = input("\nENTER PAN NUMBER\n")


while (len(str(pan_no))!=10):
print("\nENTER 10 DIGITS ONLY\PLEASE TRY AGAIN\n")
pan_no = input("\nENTER PAN NUMBER\n")
continue
pan_no1=(pan_no,)
sql_tm1="select * from employee_details where pan_no=%s;"
c.execute(sql_tm1,pan_no1)
g=c.fetchall()
if g==[]:
print("PLEASE CHOOSE THE RESPECTIVE CODE NUMBER FOR THE
RESPECTIVE DEPARTMENT")
print("\n1-->A1\n2.-->B2\n3.-->C3\n4.-->D4\n")
ch=input("\nENTER YOUR CHOICE\n")
if ch!='1' or ch!='2' or ch!='3' or ch!='4' :
while ch!='1' and ch!='2' and ch!='3' and ch!='4':
print("\nINVALID CHOICE\nPLEASE TRY AGAIN\n")
ch = input("\nENTER YOUR CHOICE\n")
continue
if ch=='1':
dept_id,salary=('dpt_A1',50000)
elif ch=='2':
dept_id,salary=('dpt_B2',40000)
elif ch=='3':
dept_id,salary=('dpt_C3',30000)
elif ch=='4':
dept_id,salary=('dpt_D4',20000)
else:
print("\nINVALID CHOICE\nPLEASE TRY AGAIN\n")

from datetime import date, datetime


print('\nENTER YOUR DATE OF BIRTH IN THR GIVEN FORMAT\
nYYYY\nMM\nDD\n')
year = input('ENTER YEAR(IN THE RANGE OF 1963-1998):\n')
while year.isdigit()==False:
print("\nINVALID FORMAT\nPLEASE TRY AGAIN\n ")
year = input('ENTER YEAR:\n')

20
y=int(year)
if y<1963 or y>1998:
print("\nNOT ELIGIBLE\nAGE IS BEYOND THE
REQUIRED RANGE\n")
ad_main_menu()
else:
month = input('ENTER MONTH:\n')
while month.isdigit()==False:
print("\nINVALID FORMAT\nPLEASE TRY AGAIN\n ")
month = int(input('ENTER MONTH:\n'))
continue
if month!='1'or month!='2'or month!='3'or month!
='4'or month!='5'or month!='6'or month!='7'or month!='8'or month!
='9'or month!='10'or month!='11'or month!='12':
while month!='1' and month!='2' and month!
='3' and month!='4' and month!='5' and month!='6' and month!='7' and
month!='8'and month!='9'and month!='10'and month!='11'and month!
='12':
print("\nINVALID CHOICE\nPLEASE TRY
AGAIN\n")
month = input("\nENTER YOUR CHOICE\n")
continue
m=int(month)
day = input('ENTER DAY:\n')
while day.isdigit()==False:
print("\nINVALID FORMAT\nPLEASE TRY AGAIN\n ")
day = input('ENTER DAY:\n')
continue
d=int(day)
if month=='1' or month=='3' or month=='5' or
month=='7' or month=='8' or month=='10' or month=='12':
while d>31:
print("\nINVALID FORMAT\nPLEASE TRY AGAIN\n
")
day = input('ENTER DAY:\n')
d=int(day)
continue
elif m==2:
while d>28:
print("\nINVALID FORMAT\nPLEASE TRY AGAIN\n
")
day = input('ENTER DAY:\n')
d=int(day)
continue
elif m==4 or m==6 or m==8 or m==9 or m==11:
while d>30:
print("\nINVALID FORMAT\nPLEASE TRY AGAIN\n
")
day = input('ENTER DAY:\n')

21
d=int(day)
continue
DOB= date(y,m,d)
else:
print("\nPAN NUMBER ALREADY EXISTS\nPLEASE TRY AGAIN")
ad_main_menu()
user_name=emp_id
pwd=emp_id+'@2023'

var=(emp_id,emp_name,designation,ph_no,emergency_ph_no,gender,qualif
ication,blood_group,permanent_address,mail_id,pan_no,dept_id,DOB,use
r_name,pwd,salary)
sql_stm= 'insert into employee_details values(%s,%s,%s,%s,
%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s);'
c.execute(sql_stm,var)
con.commit()
print("\nEMPLOYEE WITH THE ID",emp_id,'ADDED SUCCESSFULLY\
nUSER NAME=',user_name,'\nPASSWORD=',pwd,'\nDEPARTMENT ID=',dept_id)
ad_main_menu()
else:
print("EMPLOYEE ALREADY EXISTS\nPLEASE TRY AGAIN\n")
ad_main_menu()
con.close()

#-----------------------------remove
employee------------------------------------------------------------
--------------------------------------------------------
def remove_emp():
import mysql.connector as sql

con=sql.connect(host='localhost',user='root',password='Vssips2022!',
database='employee')
k=con.cursor()
if con.is_connected():
print("{:>60}".format("--->>REMOVE EMPLOYEE<<---"))

emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE EMPLOYEE


ID\n")
while emp_id1.isdigit()==False:
print("\nINVALID FORMAT\nPLEASE TRY AGAIN\n ")
emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE
EMPLOYEE ID\n")
continue
while (len(str(emp_id1))!=3):
print("ENTER 3 DIGITS ONLY\nPLEASE TRY AGAIN\nY")
emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE
EMPLOYEE ID\n")
continue

22
emp_id2=str(emp_id1)
emp_id = "vss_" + emp_id2
emp_id3=(emp_id,)

sql3="select * from employee_details where emp_id=%s"


k.execute(sql3,emp_id3)
g=k.fetchall()
if g==[]:
print("EMPLOYEE DOESN'T EXIST\nTRY AGAIN")
remove_emp()
else:
sql="delete from employee_details where emp_id=%s;"
k.execute(sql,emp_id3)
print('EMPLOYEE NUMBERED',emp_id,'REMOVED SUCCESSFULLY')
con.commit()
con.close()
ad_main_menu()
#-----------------------------update
employee------------------------------------------------------------
------------------------------------------------
def update_emp():
import mysql.connector as sql
conn = sql.connect(host = 'localhost', user =
'root',password='Vssips2022!',database='employee')
c=conn.cursor()
print('\n1. DESIGNATION')
print('\n2. MOBILE NUMBER')
print('\n3. EMERGENCY CONTACT NUMBER')
print('\n4. QUALIFICATION')
print('\n5. PERMANENT ADDRESS')
print('\n6. MAIL ID')
print('\n7. DEPARTMENT ID')
print('\n8. SALARY')

choice=input("\nCHOOSE THE RESPECTED CODES FOR UPDATING THE


FOLLOWING:\n")
if choice!='1' or choice!='2' or choice!='3' or choice!='4' or
choice!='5' or choice!='6' or choice!='7' or choice!='8':
while choice!='1' and choice!='2' and choice!='3' and
choice!='4' and choice!='5' and choice!='6' and choice!='7' and
choice!='8':
print("\nINVALID CHOICE\nPLEASE TRY AGAIN\n")
choice = input("\nENTER YOUR CHOICE AGAIN\n")
continue
emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE
EMPLOYEE ID\n")
while emp_id1.isdigit()==False:
print("\nINVALID FORMAT\nPLEASE TRY AGAIN\n ")
emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE
EMPLOYEE ID AGAIN\n")

23
continue
while (len(str(emp_id1))!=3):
print("ENTER 3 DIGITS ONLY\nPLEASE TRY AGAIN\n")
emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE
EMPLOYEE ID AGAIN\n")
continue
emp_id2=str(emp_id1)
emp_id = "vss_" + emp_id2
emp_id3=(emp_id,)
sql_tm="select * from employee_details where emp_id=%s;"
c.execute(sql_tm,emp_id3)
e=c.fetchall()

if e==[]:
print("EMPLOYEE NOT FOUND\nTRY AGAIN")
update_emp()
else:
if choice=='1':
designation = input("\nENTER EMPLOYEE DESIGNATION\
n")
var1=(designation,emp_id)
sql1 = "update employee_details set designation=%s
where emp_id=%s;"
c.execute(sql1,var1)
print("\n'EMPLOYEE DETAILS UPDATED SUCCESSFULLY'\n")

elif choice=='2':
ph_no = input("\nENTER MOBILE NUMBER\n")
while ph_no.isdigit()==False:
print("\nINVALID MOBILE NUMBER\nPLEASE TRY
AGAIN\n")
ph_no = input("\nENTER MOBILE NUMBER AGAIN\n")
continue
while (len(str(ph_no))!=10):
print("\nENTER 10 DIGITS ONLY\nPLEASE TRY AGAIN\
n")
ph_no = input("\nENTER MOBILE NUMBER AGAIN\n")
continue
var2=(ph_no,emp_id)
sql2 = "update employee_details set ph_no=%s where
emp_id=%s;"
c.execute(sql2,var2)
print("\n'EMPLOYEE DETAILS UPDATED SUCCESSFULLY'\n")

elif choice=='3':
emergency_ph_no = input("\nENTER EMERGENCY CONTACT
NUMBER\n")
while emergency_ph_no.isdigit()==False:
print("\nINVALID MOBILE NUMBER\nPLEASE TRY
AGAIN\n")

24
emergency_ph_no = input("\nENTER EMERGENCY
CONTACT NUMBER AGAIN\n")
continue
while (len(str(emergency_ph_no))!=10):
print("\nENTER 10 DIGITS ONLY\PLEASE TRY AGAIN\
n")
emergency_ph_no = input("\nENTER EMERGENCY
CONTACT NUMBER AGAIN\n")
continue
var3=(emergency_ph_no,emp_id)
sql3 = "update employee_details set emergency_ph_no=
%s where emp_id=%s;"
c.execute(sql3,var3)
print("\n'EMPLOYEE DETAILS UPDATED SUCCESSFULLY'\n")

elif choice=='4':
qualification=input("\nENTER YOUR QUALIFICATION\n")
var4=(qualification,emp_id)
sql4 = "update employee_details set qualification=%s
where emp_id=%s;"
c.execute(sql4,var4)
print("\n'EMPLOYEE DETAILS UPDATED SUCCESSFULLY'\n")

elif choice=='5':
permanent_address=input("\nPLEASE ENTER YOUR
PERMANENT ADDRESS IN NOT MORE THAN 70 CHARACTERS\n")
while (len(str(permanent_address))>70 ):
print("\nENTER WITHIN 70 CHARCTERS ONLY\nPLEASE
TRY AGAIN\n")
permanent_address = input("\nPLEASE ENTER YOUR
PERMANENT ADDRESS AGAIN\n")
continue
var5=(permanent_address,emp_id)
sql5 = "update employee_details set
permanent_address=%s where emp_id=%s;"
c.execute(sql5,var5)
print("\n'EMPLOYEE DETAILS UPDATED SUCCESSFULLY'\n")

elif choice=='6':
mail_id=input("\nENTER YOUR MAIL ID IN THE FORMAT
GIVEN BELOW \n<username>@gmail.com\n")
cm= '@gmail.com'
while cm not in mail_id:
print('\nINVALID \nPLEASE TRY AGAIN IN THE GIVEN
FORMAT\n')
mail_id=input("\nENTER YOUR MAIL ID AGAIN\n")
continue
var6=(mail_id,emp_id)
sql6 = "update employee_details set mail_id=%s where
emp_id=%s;"

25
c.execute(sql6,var6)
print("\n'EMPLOYEE DETAILS UPDATED SUCCESSFULLY'\n")

elif choice=='7':
print("\n1-->A1\n2.-->B2\n3.-->C3\n4.-->D4\n")
ch=input("\nCHOOSE EMPLOYEE'S RESPECTIVE DEPARTMENT\
n")
if ch!='1' or ch!='2' or ch!='3' or ch!='4' :
while ch!='1' and ch!='2' and ch!='3' and ch!
='4':
print("\nINVALID CHOICE\nPLEASE TRY AGAIN\
n")
ch = input("\nENTER YOUR CHOICE AGAIN\n")
continue
if ch=='1':
dept_id='dpt_A1'
elif ch=='2':
dept_id='dpt_B2'
elif ch=='3':
dept_id='dpt_C3'
elif ch=='4':
dept_id='dpt_D4'
else:
print("\nINVALID CHOICE\nPLEASE TRY AGAIN\
n")

var7=(dept_id,emp_id)
sql7 = "update employee_details set dept_id=%s where
emp_id=%s;"
c.execute(sql7,var7)
print("\n'EMPLOYEE DETAILS UPDATED SUCCESSFULLY'\n")
elif choice=='8':
salary = input("\nENTER THE SALARY\n")
while salary.isdigit()==False:
print("\nINVALID FORMAT\nPLEASE TRY AGAIN\n ")
salary = input("\nENTER THE SALARY AGAIN\n")
continue
var74=(salary,emp_id)
sql74 = "update employee_details set salary=%s where
emp_id=%s;"
c.execute(sql74,var74)
print("\n'EMPLOYEE DETAILS UPDATED SUCCESSFULLY'\n")

sql = 'select*from employee_details where emp_id=%s;'


c=conn.cursor()
c.execute(sql,emp_id3)
d=c.fetchall()
for i in d:
a1=i[0]

26
a2=i[1]
a3=i[2]
a4=i[3]
a5=i[4]
a6=i[5]
a7=i[6]
a8=i[7]
a9=i[8]
a10=i[9]
a11=i[10]
a12=i[11]
a13=i[12]
a14=i[13]
a16=i[15]
from prettytable import PrettyTable
a=PrettyTable()
a.field_names =
(['emp_name','DOB','ph_no','emergency_ph_no','gender','qualification
','blood_group','permanent_address','pan_no'])
a.add_row([a2,a13,a4,a5,a6,a7,a8,a9,a11])
print("{:>60}".format("--->>PERSONAL DETAILS<<---"))
print(a)
from prettytable import PrettyTable
b=PrettyTable()
b.field_names =
(["emp_id",'dept_id','designation','mail_id','salary'])
b.add_row([a1,a12,a3,a10,a16])
print("{:>60}".format("--->>EMPLOYEE DETAILS<<---"))
print(b)
conn.commit()
conn.close()
ad_main_menu()
#-----------------------------search
_emp----------------------------------------------------------------
----------------------------------------------------------

def search_emp():
import mysql.connector as sql

conn=sql.connect(host='localhost',user='root',password='Vssips2022!'
,database='employee')
c=conn.cursor()
if conn.is_connected():
print("{:>60}".format("--->>SEARCH EMPLOYEE<<---"))

emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE EMPLOYEE


ID\n")
while emp_id1.isdigit()==False:
print("\nINVALID FORMAT\nPLEASE TRY AGAIN\n ")

27
emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE
EMPLOYEE ID AGAIN\n")
continue
while (len(str(emp_id1))!=3):
print("ENTER 3 DIGITS ONLY\nPLEASE TRY AGAIN\nY")
emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE
EMPLOYEE ID AGAIN\n")
continue
emp_id2=str(emp_id1)
emp_id = "vss_" + emp_id2
emp_id3=(emp_id,)
sql_tm="select * from employee_details where emp_id=%s;"
c.execute(sql_tm,emp_id3)
e=c.fetchall()
if e==[]:
print("EMPLOYEE NOT FOUND\nTRY AGAIN")
search_emp()
else:
a=input("\nEMPLOYEE FOUND\nWOULD YOU LIKE TO DISPLAY THE
EMPLOYEE DETAILS??? \nENTER 1-->YES\nANY OTHER KEY-->NO\n")
if a=='1':
sql = 'select*from employee_details where emp_id=%s;'
c=conn.cursor()
c.execute(sql,emp_id3)
d=c.fetchall()
for i in d:
a1=i[0]
a2=i[1]
a3=i[2]
a4=i[3]
a5=i[4]
a6=i[5]
a7=i[6]
a8=i[7]
a9=i[8]
a10=i[9]
a11=i[10]
a12=i[11]
a13=i[12]
a14=i[13]
from prettytable import PrettyTable
a=PrettyTable()
a.field_names =
(['emp_name','DOB','ph_no','emergency_ph_no','gender','qualification
','blood_group','permanent_address','pan_no'])
a.add_row([a2,a13,a4,a5,a6,a7,a8,a9,a11])
print("{:>60}".format("--->>PERSONAL DETAILS<<---"))
print(a)
from prettytable import PrettyTable
b=PrettyTable()

28
b.field_names =
(["emp_id",'dept_id','designation','mail_id'])
b.add_row([a1,a12,a3,a10])
print("{:>60}".format("--->>EMPLOYEE DETAILS<<---"))
print(b)
conn.commit()
conn.close()
ad_main_menu()

#-----------------------------search
_emp_1-------------------------------------------

def search_emp_1():
import mysql.connector as sql

conn=sql.connect(host='localhost',user='root',password='Vssips2022!'
,database='employee')
c=conn.cursor()
if conn.is_connected():
print("{:>60}".format("--->>SEARCH EMPLOYEE<<---"))

emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE EMPLOYEE


ID\n")
while emp_id1.isdigit()==False:
print("\nINVALID FORMAT\nPLEASE TRY AGAIN\n ")
emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE
EMPLOYEE ID AGAIN\n")
continue
while (len(str(emp_id1))!=3):
print("ENTER 3 DIGITS ONLY\nPLEASE TRY AGAIN\nY")
emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE
EMPLOYEE ID AGAIN\n")
continue
emp_id2=str(emp_id1)
emp_id = "vss_" + emp_id2
emp_id3=(emp_id,)
sql_tm="select * from employee_details where emp_id=%s;"
c.execute(sql_tm,emp_id3)
e=c.fetchall()
if e==[]:
print("EMPLOYEE NOT FOUND\nTRY AGAIN")
search_emp_1()
else:
a=input("\nEMPLOYEE FOUND\nWOULD YOU LIKE TO DISPLAY THE
EMPLOYEE DETAILS??? \nENTER 1-->YES\n2-->NO\n")
if a=='1':
sql = 'select*from employee_details where emp_id=%s;'
c=conn.cursor()
c.execute(sql,emp_id3)

29
d=c.fetchall()
for i in d:
a1=i[0]
a2=i[1]
a3=i[2]
a4=i[3]
a5=i[4]
a6=i[5]
a7=i[6]
a8=i[7]
a9=i[8]
a10=i[9]
a11=i[10]
a12=i[11]
a13=i[12]
a14=i[13]
a16=i[15]
from prettytable import PrettyTable
a=PrettyTable()
a.field_names =
(['emp_name','DOB','ph_no','emergency_ph_no','gender','qualification
','blood_group','permanent_address','pan_no'])
a.add_row([a2,a13,a4,a5,a6,a7,a8,a9,a11])
print("{:>60}".format("--->>PERSONAL DETAILS<<---"))
print(a)
from prettytable import PrettyTable
b=PrettyTable()
b.field_names =
(["emp_id",'dept_id','designation','mail_id'])
b.add_row([a1,a12,a3,a10])
print("{:>60}".format("--->>OFFICE DETAILS<<---"))
print(b)
conn.close()
emp_main_menu()

#-----------------------------
display_all-------------------------------------------
def display_all():
import mysql.connector

conn=mysql.connector.connect(host='localhost',password='Vssips2022!'
,user='root',database='employee')
c=conn.cursor()
if conn.is_connected():
print("{:>80}".format("--->>DISPLAY DETAILS OF ALL
EMPLOYEES<<---"))
sql=("select * from employee_details")
c.execute(sql)
q=c.fetchall()

30
for i in q:
print("-"*160)
print('EMPLOYEE ID=',i[0],'\nEMPLOYEE NAME=',i[1])

a1=i[0]
a2=i[1]
a3=i[2]
a4=i[3]
a5=i[4]
a6=i[5]
a7=i[6]
a8=i[7]
a9=i[8]
a10=i[9]
a11=i[10]
a12=i[11]
a13=i[12]
a14=i[13]
a16=i[15]
from prettytable import PrettyTable
a=PrettyTable()
a.field_names =
(['emp_name','DOB','ph_no','emergency_ph_no','gender','qualification
','blood_group','permanent_address','pan_no'])
a.add_row([a2,a13,a4,a5,a6,a7,a8,a9,a11])
print("{:>60}".format("--->>PERSONAL DETAILS<<---"))
print(a)
from prettytable import PrettyTable
b=PrettyTable()
b.field_names =
(["emp_id",'dept_id','designation','mail_id','salary'])
b.add_row([a1,a12,a3,a10,a16])
print("\n{:>60}".format("--->>OFFICE DETAILS<<---"))
print(b)
print('\n \n \n ')

conn.commit()
conn.close()
ad_main_menu()

#-----------------------------
update_emp_1-------------------------------------------
def update_emp_1():
import mysql.connector as sql
conn = sql.connect(host = 'localhost', user =
'root',password='Vssips2022!',database='employee')
c=conn.cursor()
if conn.is_connected():
print("{:>60}".format("--->>UPDATE EMPLOYEE<<---"))

31
print('\n1. NAME')
print('\n2. MOBILE NUMBER')
print('\n3. PERMANENT ADDRESS')
print('\n4. MAIL ID')

choice=input("\nCHOOSE THE RESPECTED CODES FOR UPDATING THE


FOLLOWING:\n")
if choice!='1' or choice!='2' or choice!='3' or choice!='4':
while choice!='1' and choice!='2' and choice!='3' and
choice!='4':
print("\nINVALID CHOICE\nPLEASE TRY AGAIN\n")
choice = input("\nENTER YOUR CHOICE AGAIN\n")
continue
emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE EMPLOYEE
ID\n")
while emp_id1.isdigit()==False:
print("\nINVALID FORMAT\nPLEASE TRY AGAIN\n")
emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE
EMPLOYEE ID AGAIN\n")
continue
while (len(str(emp_id1))!=3):
print("ENTER 3 DIGITS ONLY\nPLEASE TRY AGAIN\n")
emp_id1 = input("\nENTER THE LAST THREE DIGITS OF THE
EMPLOYEE ID AGAIN\n")
continue
emp_id2=str(emp_id1)
emp_id = "vss_" + emp_id2
emp_id3=(emp_id,)
sql_tm="select * from employee_details where emp_id=%s;"
c.execute(sql_tm,emp_id3)
p=c.fetchall()

if p==[]:
print("EMPLOYEE NOT FOUND\nTRY AGAIN")
update_emp_1()
else:
if choice=='1':
emp_fname1=input("\nENTER YOUR FIRST NAME\n")
while emp_fname1.isalpha()==False:
print("\nINVALID FIRST NAME\nNAME SHOULD CONTAIN
ONLY LETTERS\nPLEASE TRY AGAIN\n")
emp_fname1=input("\nENTER YOUR FIRST NAME\n")
continue
emp_fname=emp_fname1.capitalize()
emp_lastname1=input("\nENTER YOUR LAST NAME\n")
while emp_lastname1.isalpha()==False:
print("\nINVALID LAST NAME\nNAME SHOULD CONTAIN ONLY
LETTERS\nPLEASE TRY AGAIN\n")
emp_lastname1=input("\nENTER YOUR LAST NAME\n")

32
continue
emp_lastname=emp_lastname1.capitalize()
a=str(emp_fname)
b=str(emp_lastname)
emp_name=a+" " + b
var0=(emp_name,emp_id)
sql0 = "update employee_details set emp_name=%s where
emp_id=%s;"
c.execute(sql0,var0)

elif choice=='2':
ph_no = input("\nENTER MOBILE NUMBER\n")
while ph_no.isdigit()==False:
print("\nINVALID MOBILE NUMBER\nPLEASE TRY AGAIN\n")
ph_no = input("\nENTER MOBILE NUMBER\n")
continue
while (len(str(ph_no))!=10):
print("\nENTER 10 DIGITS ONLY\nPLEASE TRY AGAIN\n")
ph_no = input("\nENTER MOBILE NUMBER\n")
continue
var2=(ph_no,emp_id)
sql2 = "update employee_details set ph_no=%s where
emp_id=%s;"
c.execute(sql2,var2)

elif choice=='3':
address=input("\nPLEASE ENTER YOUR PERMANENT ADDRESS IN
NOT MORE THAN 70 CHARACTERS\n")
while (len(str(address))>70 ):
print("\nENTER WITHIN 70 CHARCTERS ONLY\nPLEASE TRY
AGAIN\n")
address = input("\nPLEASE ENTER YOUR PERMANENT
ADDRESS IN NOT MORE THAN 70 CHARACTERS\n")
continue
var5=(address,emp_id)
sql5 = "update employee_details set permanent_address=%s
where emp_id=%s;"
c.execute(sql5,var5)

elif choice=='4':
mail_id=input("\nENTER YOUR MAIL ID IN THE FORMAT GIVEN
BELOW \n<username>@gmail.com\n")
cm= '@gmail.com'
while cm not in mail_id:
print('\nINVALID \nPLEASE TRY AGAIN IN THE GIVEN
FORMAT\n')
mail_id=input("\nENTER YOUR MAIL ID IN THE FORMAT
GIVEN BELOW \n<username>@gmail.com\n")
continue
var6=(mail_id,emp_id)

33
sql6 = "update employee_details set mail_id=%s where
emp_id=%s;"
c.execute(sql6,var6)

sql = 'select*from employee_details where emp_id=%s;'


c=conn.cursor()
c.execute(sql,emp_id3)
d=c.fetchall()
for i in d:
a1=i[0]
a2=i[1]
a3=i[2]
a4=i[3]
a5=i[4]
a6=i[5]
a7=i[6]
a8=i[7]
a9=i[8]
a10=i[9]
a11=i[10]
a12=i[11]
a13=i[12]
a14=i[13]
a16=i[15]
from prettytable import PrettyTable
a=PrettyTable()
a.field_names =
(['emp_name','DOB','ph_no','emergency_ph_no','gender','qualification
','blood_group','permanent_address','pan_no'])
a.add_row([a2,a13,a4,a5,a6,a7,a8,a9,a11])
print("{:>60}".format("--->>PERSONAL DETAILS<<---"))
print(a)
from prettytable import PrettyTable
b=PrettyTable()
b.field_names =
(["emp_id",'dept_id','designation','mail_id','salary'])
b.add_row([a1,a12,a3,a10,a16])
print("{:>60}".format("--->>OFFICE DETAILS<<---"))
print(b)
conn.commit()
conn.close()
emp_main_menu()
#-----------------monthly salary slip admin------------------------
def salary_slip_monthly_ad():
import mysql.connector as sql

conn=sql.connect(host='localhost',user='root',password='Vssips2022!'
,database='employee')
d=conn.cursor()
if conn.is_connected():

34
print("{:>60}".format("--->>DISPLAY MONTHLY SALARY
SLIP<<---\n"))
pan_no1=input("\nENTER PAN NUMBER\n")
while (len(str(pan_no1))!=10):
print("INVALID LENGTH OF PAN NUMBER!!TRY AGAIN")
pan_no1=input("\nENTER PAN NUMBER\n")
pan_no2=(pan_no1,)
sql_sql="select * from employee_details where pan_no=%s;"
d.execute(sql_sql,pan_no2)
e=d.fetchall()
if e==[]:
print("EMPLOYEE NOT FOUND")
print("WOULD YOU LIKE TO GO BACK TO THE PREVIUOS
FUNCTION??")
axy=input("PRESS 1 FOR GOING BACK AND ANY OTHER KEY TO
CONTINUE")
if axy=="1":
ad_main_menu()
else:
salary_slip_monthly_ad()
else:

sqlo="select dept_id from employee_details where pan_no=%s"


d.execute(sqlo,pan_no2)
tr=d.fetchall()
for un in tr:
"""print(un)"""
for yop in un:
"""print(yop)"""
txp=yop
typ=(txp,)
sql_tm="select deduction_1 from salary_info where dept_id=
%s;"
d.execute(sql_tm,typ)
e=d.fetchall()
"""print(e)"""

sql_mt="select deduction_2 from salary_info where dept_id=


%s;"
d.execute(sql_mt,typ)
g=d.fetchall()
"""print(g)"""

x=tuple(e)
"""print(x)"""
for i in x:
"""print(i,end="")"""
for j in i:
"""print(j):"""
y=j

35
"""print(y)"""

q=tuple(g)
"""print(q)"""
for s in q:
"""print(s,end="")"""
for h in s:
"""print(h)"""
v=h
"""print(v)"""

sql2="select salary from employee_details where pan_no=%s;"


d.execute(sql2,pan_no2)
te=d.fetchall()
"""print(te)"""

for ai in te:
"""print(ai,end="")"""
for aq in ai:
"""print(aq)"""
aw=aq
"""print("salary=",aw)"""

sql5="select emp_name from employee_details where pan_no=


%s;"
d.execute(sql5,pan_no2)
yw=d.fetchall()
"""print(yw)"""

for ao in yw:
"""print(ao,end="")"""
for ay in ao:
"""print(ay)"""
aew=ay
"""print("name of the employee=",aew)"""

sql99="select emp_id from employee_details where pan_no=%s"


d.execute(sql99,pan_no2)
wool=d.fetchall()

for ok in wool:
"print"
for uikl in ok:
"print"

36
def leaves():
abso=input("\nENTER NUMBER OF LEAVES TAKEN AFTER TEN
DAYS OF ALLOWED LEAVES\n ")
if abso!="0" and abso!="1" and abso!="2" and abso!="3"
and abso!="4" and abso!="5" and abso!="6" and abso!="7" and abso!
="8" and abso!="9" and abso!="10" and abso!="11" and abso!="12" and
abso!="13" and abso!="14" and abso!="15" and abso!="16" and abso!
="17" and abso!="18" and abso!="19" and abso!="20":
print("INVALID NO. OF LEAVES")
leaves()
else:
dnum=int(abso)
ubch=2*dnum
oji=(ubch/100)*aw
"""print(oji)"""

t=y+v+oji
"""r=print("total deduction=",t)"""
aa=aw-t
"""print("net=",aa)"""

from prettytable import PrettyTable


ayt=PrettyTable()
ayt.field_names=["EMP_ID","EMP_NAME","DEPT_ID","PAN
NO.","SALARY","DEDUCTION_1","DEDUCTION_2","DEDUCTION_LEAVES","TOTAL_
DEDUCTION","NET"]
ayt.add_row([uikl,aew,yop,pan_no1,aw,y,v,oji,t,aa])
print(ayt)

leaves()
ad_main_menu()
#----------------------------yearly salary
slip-------------------------
def salary_slip_year_ad():
import mysql.connector as sql

conn=sql.connect(host='localhost',user='root',password='Vssips2022!'
,database='employee')
d=conn.cursor()
if conn.is_connected():
print("{:>60}".format("--->>DISPLAY YEARLY SALARY SLIP<<---\
n"))

pan_no1=input("\nENTER PAN NUMBER\n")


while (len(str(pan_no1))!=10):
print("INVALID LENGTH OF PAN NUMBER!!TRY AGAIN")
pan_no1=input("\nENTER PAN NUMBER\n")
pan_no2=(pan_no1,)
sql_sql="select * from employee_details where pan_no=%s;"

37
d.execute(sql_sql,pan_no2)
e=d.fetchall()
if e==[]:
print("EMPLOYEE NOT FOUND TRY AGAIN")
print("WOULD YOU LIKE TO GO BACK TO THE PREVIUOS
FUNCTION??")
axy=input("PRESS 1 FOR GOING BACK AND ANY OTHER KEY TO
CONTINUE")
if axy=="1":
ad_main_menu()
else:
salary_slip_year_ad()
else:

sqlo="select dept_id from employee_details where pan_no=%s"


d.execute(sqlo,pan_no2)
tr=d.fetchall()
for un in tr:
"""print(un)"""
for yop in un:
"""print(yop)"""
txp=yop
typ=(txp,)
sql_tm="select deduction_1 from salary_info where dept_id=
%s;"
d.execute(sql_tm,typ)
e=d.fetchall()
"""print(e)"""

sql_mt="select deduction_2 from salary_info where dept_id=


%s;"
d.execute(sql_mt,typ)
g=d.fetchall()
"""print(g)"""

x=tuple(e)
"""print(x)"""
for i in x:
"""print(i,end="")"""
for j in i:
"""print(j):"""
y=j
"""print(y)"""
ydeduction1=y*12

q=tuple(g)
"""print(q)"""
for s in q:
"""print(s,end="")"""

38
for h in s:
"""print(h)"""
v=h
"""print(v)"""
ydeduction2=v*12

sql2="select salary from employee_details where pan_no=%s;"


d.execute(sql2,pan_no2)
te=d.fetchall()
"""print(te)"""

for ai in te:
"""print(ai,end="")"""
for aq in ai:
"""print(aq)"""
aw=aq
"""print("salary=",aw)"""
ysalary=aw*12

sql5="select emp_name from employee_details where pan_no=


%s;"
d.execute(sql5,pan_no2)
yw=d.fetchall()
"""print(yw)"""

for ao in yw:
"""print(ao,end="")"""
for ay in ao:
"""print(ay)"""
aew=ay
"""print("name of the employee=",aew)"""

t=ydeduction1+ydeduction2
"""r=print("total deduction=",t)"""
aa=ysalary-t
"""print("net=",aa)"""

sql99="select emp_id from employee_details where pan_no=%s"


d.execute(sql99,pan_no2)
wool=d.fetchall()

for ok in wool:
"print"
for uikl in ok:
"print"

39
from prettytable import PrettyTable
ayt=PrettyTable()
ayt.field_names=["EMP_ID","EMP_NAME","DEPT_ID","PAN
NO.","SALARY","DEDUCTION_1","DEDUCTION_2","TOTAL_DEDUCTION","NET"]

ayt.add_row([uikl,aew,yop,pan_no1,ysalary,ydeduction1,ydeduction2,t,
aa])
print(ayt)
employee_report()
ad_main_menu()

#---------------employee count-------------------------
def emp_count():
import mysql.connector as sql

conn=sql.connect(host='localhost',user='root',password='Vssips2022!'
,database='employee')
d=conn.cursor()
print("SELECT YOUR DEPARTMENT\n")
print("\nSELECT 1 TO PRINT EMPLOYEE DETAILS FROM
DEPARTMENT(dpt_A1)\n\nSELECT 2 TO PRINT EMPLOYEE DETAILS FROM
DEPARTMENT(dpt_B2)\n\nSELECT 3 TO PRINT EMPLOYEE DETAILS FROM
DEPARTMENT(dpt_C3)\n\nSELECT 4 TO PRINT EMPLOYEE DETAILS FROM
DEPARTMENT(dpt_D4)")
a=input("\nENTER YOUR CHOICE\n")
dpt=None
if a=="1" or a==" 1" or a=="1 " or a==" 1 ":
dpt="dpt_A1"
elif a=="2" or a==" 2" or a=="2 " or a==" 2 ":
dpt="dpt_B2"
elif a=="3" or a==" 3" or a=="3 " or a==" 3 ":
dpt="dpt_C3"
elif a=="4" or a==" 4" or a=="4 " or a==" 4 ":
dpt="dpt_D4"
else:
print("INVALID CHOICE")
emp_count()

sql="select count(dept_id) from employee_details where dept_id=


%s"
dpt3=(dpt,)
d.execute(sql,dpt3)
e=d.fetchall()
for i in e:
"""print"""
for t in i:
"""print"""
print("NUMBER OF EMPLOYEES IN DEPARTMENT", dpt , "are" , t)
employee_report()

40
#-----------------displaying employees of a
department------------------
def dpt_display():
import mysql.connector as sql

conn=sql.connect(host='localhost',user='root',password='Vssips2022!'
,database='employee')
d=conn.cursor()
"""print("WOULD YOU LIKE TO CONTINUE OR GO BACK TO THE REPORT
FUNCTON??")
A=input("\nENTER '6' FOR GOING BACK TO REPORT FUNCTION AND ANY
OTHER KEY TO CONTINUE\n")
if A=="6":
employee_report()
else:"""
print("SELECT YOUR DEPARTMENT")
print("SELECT 1 TO PRINT EMPLOYEE DETAILS FROM
DEPARTMENT(dpt_A1)\n\nSELECT 2 TO PRINT EMPLOYEE DETAILS FROM
DEPARTMENT(dpt_B2)\n\nSELECT 3 TO PRINT EMPLOYEE DETAILS FROM
DEPARTMENT(dpt_C3)\n\nSELECT 4 TO PRINT EMPLOYEE DETAILS FROM
DEPARTMENT(dpt_D4)")
a=input("\nENTER YOUR CHOICE\n")
dpt=None
if a=="1" or a==" 1" or a=="1 " or a==" 1 ":
dpt="dpt_A1"
elif a=="2" or a==" 2" or a=="2 " or a==" 2 ":
dpt="dpt_B2"
elif a=="3" or a==" 3" or a=="3 " or a==" 3 ":
dpt="dpt_C3"
elif a=="4" or a==" 4" or a=="4 " or a==" 4 ":
dpt="dpt_D4"
else:
print("INVALID CHOICE")
dpt_display()
sql="select * from employee_details where dept_id=%s"
dpt3=(dpt,)
d.execute(sql,dpt3)
e=d.fetchall()
from prettytable import PrettyTable
print("-----> DETAILS OF EMPLOYEES IN DEPARTMENT",dpt,"<-----")
for i in e:
a=i[0]
b=i[1]
c=i[2]
e=i[3]
f=i[4]
g=i[5]
h=i[6]
j=i[7]
k=i[8]

41
l=i[9]
m=i[10]
n=i[11]
o=i[12]
p=i[13]
q=i[14]
x=PrettyTable()
x.field_names=["EMP ID","EMP NAME","PHONE NO.","PERMANENT
ADDRESS","MAIL ID"]
x.add_row([a,b,e,k,l])
print(x)
employee_report()

#----------------------------emp salary
monthly-------------------------------------------
def salary_slip_monthly_emp():
import mysql.connector as sql

conn=sql.connect(host='localhost',user='root',password='Vssips2022!'
,database='employee')
d=conn.cursor()
if conn.is_connected():
print("{:>60}".format("--->>DISPLAY MONTHLY SALARY
SLIP<<---\n"))

pan_no1=input("\nENTER PAN NUMBER\n")


while (len(str(pan_no1))!=10):
print("INVALID LENGTH OF PAN NUMBER!!TRY AGAIN\n")
pan_no1=input("\nENTER PAN NUMBER\n")
pan_no2=(pan_no1,)
sql_sql="select * from employee_details where pan_no=%s;"
d.execute(sql_sql,pan_no2)
e=d.fetchall()

if e==[]:
print("\nEMPLOYEE NOT FOUND\n")
print("\nWOULD YOU LIKE TO GO BACK TO THE PREVIUOS
FUNCTION??\n")
axy=input("\nPRESS 1 FOR GOING BACK AND ANY OTHER KEY TO
CONTINUE\n")
if axy=="1":
emp_main_menu()
else:
salary_slip_monthly_emp()
else:
sql_sql="select * from employee_details where pan_no=%s;"
d.execute(sql_sql,pan_no2)
e=d.fetchall()
if e==[]:
salary_slip_monthly()

42
else:
sqlo="select dept_id from employee_details where pan_no=
%s"
d.execute(sqlo,pan_no2)
tr=d.fetchall()
for un in tr:
"""print(un)"""
for yop in un:
"""print(yop)"""
txp=yop
typ=(txp,)
sql_tm="select deduction_1 from salary_info where
dept_id=%s;"
d.execute(sql_tm,typ)
e=d.fetchall()
"""print(e)"""

sql_mt="select deduction_2 from salary_info where


dept_id=%s;"
d.execute(sql_mt,typ)
g=d.fetchall()
"""print(g)"""

x=tuple(e)
"""print(x)"""
for i in x:
"""print(i,end="")"""
for j in i:
"""print(j):"""
y=j
"""print(y)"""

q=tuple(g)
"""print(q)"""
for s in q:
"""print(s,end="")"""
for h in s:
"""print(h)"""
v=h
"""print(v)"""

sql2="select salary from employee_details where pan_no=


%s;"
d.execute(sql2,pan_no2)
te=d.fetchall()
"""print(te)"""

43
for ai in te:
"""print(ai,end="")"""
for aq in ai:
"""print(aq)"""
aw=aq
"""print("salary=",aw)"""

sql5="select emp_name from employee_details where


pan_no=%s;"
d.execute(sql5,pan_no2)
yw=d.fetchall()
"""print(yw)"""

for ao in yw:
"""print(ao,end="")"""
for ay in ao:
"""print(ay)"""
aew=ay
"""print("name of the employee=",aew)"""

sql99="select emp_id from employee_details where pan_no=


%s"
d.execute(sql99,pan_no2)
wool=d.fetchall()

for ok in wool:
"print"
for uikl in ok:
"print"

def leaves():
abso=input("\nENTER NUMBER OF LEAVES TAKEN AFTER TEN
DAYS OF ALLOWED LEAVES\n ")
if abso!="0" and abso!="1" and abso!="2" and abso!
="3" and abso!="4" and abso!="5" and abso!="6" and abso!="7" and
abso!="8" and abso!="9" and abso!="10" and abso!="11" and abso!="12"
and abso!="13" and abso!="14" and abso!="15" and abso!="16" and
abso!="17" and abso!="18" and abso!="19" and abso!="20":
print("INVALID NO. OF LEAVES")
leaves()
else:
dnum=int(abso)
ubch=2*dnum
oji=(ubch/100)*aw
"""print(oji)"""

t=y+v+oji
"""r=print("total deduction=",t)"""

44
aa=aw-t
"""print("net=",aa)"""

from prettytable import PrettyTable


ayt=PrettyTable()

ayt.field_names=["EMP_ID","EMP_NAME","DEPT_ID","PAN
NO.","SALARY","DEDUCTION_1","DEDUCTION_2","DEDUCTION_LEAVES","TOTAL_
DEDUCTION","NET"]

ayt.add_row([uikl,aew,yop,pan_no1,aw,y,v,oji,t,aa])
print(ayt)

leaves()
emp_main_menu()
#----------------------------emp salary
yearly-------------------------------------------
def salary_slip_year_emp():
import mysql.connector as sql

conn=sql.connect(host='localhost',user='root',password='Vssips2022!'
,database='employee')
d=conn.cursor()
if conn.is_connected():
print("{:>60}".format("--->>DISPLAY MONTHLY SALARY
SLIP<<---\n"))

pan_no1=input("\nENTER PAN NUMBER\n")


while (len(str(pan_no1))!=10):
print("INVALID LENGTH OF PAN NUMBER!!TRY AGAIN\n")
pan_no1=input("\nENTER PAN NUMBER\n")
pan_no2=(pan_no1,)
sql_sql="select * from employee_details where pan_no=%s;"
d.execute(sql_sql,pan_no2)
e=d.fetchall()
if e==[]:
print("EMPLOYEE NOT FOUND TRY AGAIN\n")
print("WOULD YOU LIKE TO GO BACK TO THE PREVIUOS FUNCTION??\
n")
axy=input("PRESS 1 FOR GOING BACK AND ANY OTHER KEY TO
CONTINUE\n")
if axy=="1":
emp_main_menu()
else:
salary_slip_year_emp()
else:

sqlo="select dept_id from employee_details where pan_no=%s"


d.execute(sqlo,pan_no2)

45
tr=d.fetchall()
for un in tr:
"""print(un)"""
for yop in un:
"""print(yop)"""
txp=yop
typ=(txp,)
sql_tm="select deduction_1 from salary_info where dept_id=
%s;"
d.execute(sql_tm,typ)
e=d.fetchall()
"""print(e)"""

sql_mt="select deduction_2 from salary_info where dept_id=


%s;"
d.execute(sql_mt,typ)
g=d.fetchall()
"""print(g)"""

x=tuple(e)
"""print(x)"""
for i in x:
"""print(i,end="")"""
for j in i:
"""print(j):"""
y=j
"""print(y)"""
ydeduction1=y*12

q=tuple(g)
"""print(q)"""
for s in q:
"""print(s,end="")"""
for h in s:
"""print(h)"""
v=h
"""print(v)"""
ydeduction2=v*12

sql2="select salary from employee_details where pan_no=%s;"


d.execute(sql2,pan_no2)
te=d.fetchall()
"""print(te)"""

for ai in te:
"""print(ai,end="")"""
for aq in ai:
"""print(aq)"""

46
aw=aq
"""print("salary=",aw)"""
ysalary=aw*12

sql5="select emp_name from employee_details where pan_no=


%s;"
d.execute(sql5,pan_no2)
yw=d.fetchall()
"""print(yw)"""

for ao in yw:
"""print(ao,end="")"""
for ay in ao:
"""print(ay)"""
aew=ay
"""print("name of the employee=",aew)"""

t=ydeduction1+ydeduction2
"""r=print("total deduction=",t)"""
aa=ysalary-t
"""print("net=",aa)"""

sql99="select emp_id from employee_details where pan_no=%s"


d.execute(sql99,pan_no2)
wool=d.fetchall()

for ok in wool:
"print"
for uikl in ok:
"print"

from prettytable import PrettyTable


ayt=PrettyTable()
ayt.field_names=["EMP_ID","EMP_NAME","DEPT_ID","PAN
NO.","SALARY","DEDUCTION_1","DEDUCTION_2","TOTAL_DEDUCTION","NET"]

ayt.add_row([uikl,aew,yop,pan_no1,ysalary,ydeduction1,ydeduction2,t,
aa])
print(ayt)
emp_main_menu()
#----------------------------
report-------------------------------------------
def employee_report():
print("\nENTER 1 TO DISPLAY MONTHLY SALARY SLIP OF AN EMPLOYEE\
n")
print("\nENTER 2 TO DISPLAY YEARLY SALARY SLIP OF AN EMPLOYEE\
n")

47
print("\nENTER 3 TO SEE THE NUMBER OF EMPLOYEES IN A DEPARTMENT\
n")
print("\nENTER 4 TO DISPLAY THE DETAILS OF EMPLOYEES IN A
DEPARTMENT\n")
print("\nENTER 5 TO RETURN TO MAIN PROGRAM\n")
a=input("\nENTER YOUR CHOICE\n")
if a=="1" or a==" 1" or a=="1 " or a==" 1 ":
salary_slip_monthly_ad()
elif a=="2" or a==" 2" or a=="2 " or a==" 2 ":
salary_slip_year_ad()
elif a=="3" or a==" 3" or a=="3 " or a==" 3 ":
emp_count()
elif a=="4" or a==" 4" or a=="4 " or a==" 4 ":
dpt_display()
elif a=="5" or a==" 5" or a=="5 " or a==" 5 ":
print("{:>50}".format("--->>^_^THANK YOU^_^<<---\n"))
print("\nMAIN FUNCTION\n")
ad_main_menu()
else:
print("INVALID CHOICE")
employee_report()
#-----------------------------
ad_main_menu-------------------------------------------
def ad_main_menu():
print("\n\n1. ADD EMPLOYEE")
print('\n2. UPDATE EMPLOYEE')
print('\n3. SEARCH AND DISPLAY EMPLOYEE')
print('\n4. DISPLAY ALL EMPLOYEE DETAILS')
print('\n5. REMOVE EMPLOYEE')
print("\n6. EMPLOYEE REPORT")
print('\n7. CLOSE APPLICATION')
print('\n\n')
choice = input('ENTER YOUR CHOICE...:\n')
while choice.isdigit()==False:
print("\nINVALID FORMAT\nPLEASE TRY AGAIN\n ")
choice = input('ENTER YOUR CHOICE...:\n')
continue
if choice =="1":
add_emp()
elif choice == "2":
update_emp()
elif choice == "3":
search_emp()
elif choice == "4":
display_all()
elif choice == "5":
remove_emp()
elif choice == "6":
employee_report()
elif choice == "7":

48
print("{:>50}".format("--->>^_^THANK YOU^_^<<---"))
else:
print("INVALID CHOICE\nENTER ONLY 1-6\n")
ad_main_menu()
#ad_main_menu()
#-----------------------------
emp_main_menu-------------------------------------------
def emp_main_menu():
print('\n1. PAYSLIP(monthly)\n')
print('\n2. PAYSLIP(yearly)\n')
print('\n3. UPDATE EMPLOYEE\n')
print('\n4. SEARCH AND DISPLAY EMPLOYEE\n')
print('\n5. CLOSE APPLICATION\n')
print('\n\n')

choice = input('ENTER YOUR CHOICE...:\n')


while choice.isdigit()==False:
print("\nINVALID FORMAT\nPLEASE TRY AGAIN\n ")
choice = input('ENTER YOUR CHOICE...:\n')
continue
if choice =="1":
salary_slip_monthly_emp()
elif choice == "2":
salary_slip_year_emp()
elif choice == "3":
update_emp_1()
elif choice == "4":
search_emp_1()
elif choice == "5":
print("{:>50}".format("--->>^_^THANK YOU^_^<<---"))
else:
print("INVALID CHOICE\nENTER ONLY 1-4\n")
emp_main_menu()
#emp_main_menu()

#----------------------------
login_type-------------------------------------------
def log_in():
log_in=input("\nPLEASE CHOOSE A LOG IN TYPE\n1-->ADMIN\n2--
>EMPLOYEE\n")
if log_in!='1' or log_in!='2':
while log_in!='1' and log_in!='2':
print("\nINVALID CHOICE\nPLEASE TRY AGAIN\n")
log_in=input("\nPLEASE CHOOSE A LOG IN TYPE\n1-->ADMIN\
n2-->EMPLOYEE\n")
continue
if log_in=='1':
ad_login()
else:
emp_login()

49
log_in()

SAMPLE OUTPUT

50
51
52
INSTALLATION PROCEDURE

employee management system :-

-------------------------------------

Pre-Requisites :-

------------------------

1. You have to have the following softwares for the successful


running of this software; which are

I) Python (Only for the First time), it is downloadable


from 'www.python.org'.

II) MySQL (Only for the First time), it is downloadable


from 'www.mysql.org'.

Installation :-

-------------------

1. There will be two folders namely 'TABLEE Files' and 'MAIN


files'.

2. The folder 'TABLEE Files' will contain the source code of


the software in python language. If you are running the software by
the 3rd step mentioned below you have to pre install the following
modules :-

A.) mysql.connector

B.)IMPORT time

53
3. Open the files in any python editors and run it to start
and work on the software.

4. The folder '6054' will contain two files namely 'main.exe'


and 'Tables_in_mysql.exe'.

5. First run the 'Tables_in_mysql.exe' to create the tables in


MySQL.

6. Then run the file 'main.exe' to start and work on the


software.

54
TESTING

Software Testing is an empirical investigation conducted to provide


stakeholders with information about the quality of the product or service under test ,
with respect to the context in 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 and
white box testing. These two approaches are used to describe the point of view that
a test engineer takes when designing test cases.

BLACK BOX TESTING


Black box testing treats the software as a "black box," without any knowledge
of internal implementation. Black box testing methods include: equivalence
partitioning, boundary value analysis, all-pairs testing, fuzz testing, model-based
testing, traceability matrix, exploratory testing and specification-based testing.

55
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 thorough test cases
to be provided to the tester, who then can simply verify that for a given input, the
output value (or behaviour), either "is" or "is not" the same as the expected value
specified in the test case. Specification-based testing is necessary, but it is
insufficient to guard against certain risks

ADVANTAGES AND DISADVANTAGES

The black box tester has no "bonds" with the code, and a tester's perception
is very simple: a code must have bugs. Using the principle, "Ask and you shall
receive," black box testers find bugs where programmers don't. But, on the other
hand, black box testing has been said to be "like a walk in a dark labyrinth without a
flashlight," because the tester doesn't know how the software being tested was
actually constructed.
That's why there are situations when (1) a black box tester writes many test
cases to check something that can be tested by only one test case, and/or (2) some
parts of the back end are not tested at all. Therefore, black box testing has the
advantage of "an unaffiliated opinion," on the one hand, and the disadvantage of
"blind exploring," on the other.

56
WHITE BOX TESTING

White box testing, by contrast to black box testing, is when the tester has
access to the internal data structures and algorithms (and the code that implement
these)

Types of white box testing:-


The following types of white box testing exist:
api testing - Testing of the application using Public and Private APIs.
Code coverage - creating tests to satisfy some criteria of code
coverage.
For example, the test designer can create tests to cause all statements in the
program to be executed at least once.
fault injection methods.
mutation testing methods.
static testing - White box testing includes all static testing.

CODE COMPLETENESS EVALUATION

White box testing methods can also be used to evaluate the completeness of
a test suite that was created with black box testing methods. This allows the software
team to examine parts of a system that are rarely tested and ensures that the most
important function points have been tested.

Two common forms of code coverage are:


Function Coverage: Which reports on functions executed and
Statement Coverage: Which reports on the number of lines executed
to complete the test.
They both return coverage metric, measured as a percentage

57
HARDWARE AND SOFTWARE REQUIREMENTS

I.OPERATING SYSTEM : WINDOWS 7 AND ABOVE

II. PROCESSOR : Intel(R) Core(TM) i3-4170 CPU @ 3.70GHz

IV. RAM : 8.00GB

V. Hard disk : 465.76 GB OR ABOVE

VI. CD/DVD r/w multi drive combo: (If back up required)

VII. FLOPPY DRIVE 1.44 MB : (If Backup required)

VIII. MONITOR : 14.1 or 15 -17 inch

IX. Key board and mouse

X. Printer : required

SOFTWARE REQUIREMENTS:

I. Windows OS
II. Python

BIBLIOGRAPHY

1. Computer science With Python - Class XI By : SumitaArora


2. Website: https://www.geeksforgeeks.com
***

58

You might also like