PROJECTPROJECTDIGITAL
PHONEBOOK DIRECTORY
HOSTELMANAGEMENTSYSTEM
NAME : Sushant Gupta
ROLL NO :
CLASS : XII
SUBJECT : Computer Science(083)
SCHOOL : THE LUCKNOW PUBLIC COLLEGIATE
SESSION : 2023-24
TABLE OF CONTENTS
• Lab Certificate
• Acknowledgement
• Introduction
• Objectives of the project
• Proposed system
• System Development Life Cycle (SDLC)
• Phases of System Development Life Cycle
• Hardware and Software requirement
• Description of the project
• Functions& methods and their objectives
• Code
• Output
• Bibliography
LAB CERTIFICATE
This is to certify that Sushant Gupta of class 12th
has completed this project titled “Digital Phone
book Directory” under my guidance and this
project may be considered as the part of the
Practical exam of AISSCE conducted by CBSE.
Subject teacher:
Mrs Santwana Srivastava
External Examiner:
ACKNOWLEDGEMENT
It would be my utmost pleasure to express my gratitude
and sincere thanks to my principal Dr.Jawaid Alam Khan
who helped me a lot.
I would like to express my deep sense of thanks and
gratitude to my subject teacher Mrs. Santwana Srivastava
for guiding me immensely through the course of project.
Her constructive advice and constant motivation is
responsible for the successful completion of this project.
I also thank to my parents for their motivation and support.
I must thanks to my classmates for their timely help and
support for completion of this project.
- Sushant Gupta
DIGITAL PHONEBOOK DIRECTORY
INTRODUCTION :
This project is all about a software for Phonebook Directory. It is a
very simple and mini project that can help you understand the basic
concepts of function, file handling and data structure.
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.
• Write programs utilizing modern software tools.
• Write effective procedural code to solve small to medium sized
problems.
• Students will demonstrate a breadth of knowledge in computer
science, as exemplified in the areas of systems, theory and
software development.
• 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.
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.
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.
Software development projects typically include initiation, planning, design,
development, testing, implementation, and maintenance phases.
PICTORIAL REPRESENTATION OF SDLC:
HARDWARE AND SOFTWARE REQUIREMENTS
HAERDWARE REQUIREMENTS:
I. PROCESSOR : PENTIUM(ANY) OR AMD
ATHALON(3800+- 4200+ DUAL CORE)
II. MOTHERBOARD : 1.845 OR 915,995 FOR PENTIUM 0R
MSI
K9MM-V VIA K8M800+8237R PLUS
CHIPSET FOR AMD ATHALON
III. RAM : 512MB+
IV. Hard disk : SATA 40 GB OR ABOVE
V. MONITOR 14.1 or 15 -17 inch
VI. Key board and mouse
VII Printer
SOFTWARE REQUIREMENTS:
• WINDOWS 7 AND ABOVE
• Python
• MySQL connector module
DESCRIPTION OF THE PROJECT
This project is made on a basic idea of a digital
phonebook. It keeps a record of all the phone
numbers inserted in the form of a TABLE in MySQL
Database.
The following operations can be performed in this
project:
1. Add a new contact
2. View all contacts
3.Search a contact
4.Delete a contact
Functions & methods and their objectives
1. BUILT-IN Functions & methods
input() : Reads a line entered on a console by an input device
and convert it into a string and returns it.
int() : int() converts the specified value in to integer number.
print() : Prints the specified message to the screen.
append() : The append() method appends an element to the
end of the list.
commit() : commit() method sends a commit statement to the
MySQL server, committing the current transaction. execute() :
Executes a SQL query given via python.
fetchall() : Selects all the records in a table.
2. UDF (User Defined Functions)
add_contact() : To add a new contact in your phonebook.
view_contact() : To view all the contacts already present in your
phonebook. del_contact() : To delete a contact from your
phonebook.
Main_Menu() : Shows all the available options to choose from.
CODING
DBMS: MySQL
Host : localhost
User : root
Password: admin
Database : contact
Table Structure : CONTACT BOOK
PYTHON CODE
# This program implements contact book of mobileusing
Python and MySQL connectivity #Programmed by Dev
import os
import platform
import mysql.connector
mydb=mysql.connector.connect(host="localhost",user="r
oot",passwd="admin",database="contact")
mycursor=mydb.cursor()
def add_contact():
L=[]
mobile_no=input("Enter Moobile number(10 Digits): ")
if len(mobile_no)!=10:
print("invalid no!!")
mobile_no=input("Enter again(10 Digits): ")
L.append(mobile_no)
name=input("Enter the Name :")
L.append(name )
address=input("Enter address : ")
L.append(address)
email=input("Enter the email : ")
L.append(email)
cont=(L)
sql="insert into contactbook
(mobile_no,name,address,email)values(%s,%s,%s,%s)"
mycursor.execute(sql,cont)
mydb.commit()
def search_contact():
print("Select the search criteria : ")
print("1. Mobile_no")
print("2. Name")
print("3. Address")
print("4. email")
print("5. All contacts")
ch=int(input("Enter the choice : "))
if (ch==1):
s=int(input("Enter mobile Nummber : "))
rl=(s,)
sql=("select * from contactbook where mobile_no
=%s")%s
mycursor.execute(sql)
res=mycursor.fetchall()
print(res)
elif (ch==2):
s=input("Enter Name : ")
rl=(s,)
sql=("select * from contactbook where name =
'%s'")%s
mycursor.execute(sql)
res=mycursor.fetchall()
print(res)
elif (ch==3):
s=input("Enter address : ")
rl=(s,)
sql="select * from contactbook where address =
'%s'"%s
mycursor.execute(sql)
res=mycursor.fetchall()
print(res)
elif (ch==4):
s=input("Enter email : ")
rl=(s,)
sql="select * from contactbook where
email='%s'"%s
mycursor.execute(sql)
res=mycursor.fetchall()
print(res)
elif (ch==5):
sql="select * from contactbook"
mycursor.execute(sql)
res=mycursor.fetchall()
print("The contact details are as follows : ")
print("(mobile_no , name , address ,email )")
for x in res:
print(x)
def view_contact():
sql="select * from contactbook "
mycursor.execute(sql)
res=mycursor.fetchall()
print("The contact details are as follows : ")
print("(mobile_no , name , address ,email )")
for x in res:
print(x)
def contact():
name=input("Enter the name to be deleted : ")
rl=(name,)
sql="delete from contact_book where name=%s"
mycursor.execute(sql,rl)
mydb.commit()
def Main_Menu():
print("Enter 1 : TO ADD NEW CONTACT")
print("Enter 2 : TO VIEW ALL CONTACTS ")
print("Enter 3 : TO SEARCH A CONTACT ")
print("Enter 4 : TO DELETE A CONTACT")
try: #Using Exceptions For Validation
userInput = int(input("Please Select An Above
Option: ")) #Will Take Input From User
except ValueError:
exit("\nHey! That's Not A Number") #Error Message
else:
print("\n") #Print New Line
if(userInput==1):
add_contact()
elif (userInput==2) :
view_contact()
elif(userInput==3):
search_contact()
elif (userInput==4):
del_contact()
else:
print("Enter correct choice. . . ")
Main_Menu()
ch = input("\nwant to continue Y/N: ")
while(ch == 'Y' or ch=='y'):
print(os.system('cls')) #_main_ x="" Main_Menu()
ch = input("\nwant To Run Again Y/N: ")
while True:
if ch=="Y" or ch=="y":
Main_Menu()
elif ch=="n" or ch=="N":
break
OUTPUT
• Computer science With
Python - Class XII By :
Sumita Arora
• www.pythonworld.com
• www.sharestock.in