You are on page 1of 16

COMPUTER SCIENCE

(083) PROJECT FILE

SUBMITTED BY:
NAME: KRUTIK.R
ROLL NO: 17
CLASS: XII-G

UDGAM SCHOOL FOR


CHILDREN
THALTEJ, AHMEDABAD
Session: 2022 -23
TELEPHONE
DIRECTORY SYSTEM
Particulars of the student:
Name: Krutiksinh R
Roll No: 17
Class: XII-G

Particulars of the supervisor:


Name: Yogini Pathak
Designation: PGT – Computer (Sr. Secondary Section)
ACKNOWLEDGEMENT
It is my privilege to express my sincerest regards to all who directly or
indirectly helped me to complete my project work in Computer Science
under the curriculum of Class XII as per CBSE pattern.
I, deeply express my sincere thanks to our Principal, Ms. Sujata Tandon
for her noble guidance & caring during my school life and also for
providing with sufficient facilities which have contributed to the
successful completion of this work.
I hereby, acknowledge my heartiest gratitude to our computer science
teacher Ms. Yogini Pathak, for her valuable inputs, able guidance,
encouragement, whole-hearted co-operation and constructive criticism
throughout the duration of our project work / studies, which inspired me to
the very height of sincerity that led me all the way to accomplish this
work.
I take this opportunity to thank all my teachers also who have directly or
indirectly helped me in this work. I pay my respects and love to my
parents and all other family members for their love and encouragement
throughout my work.

Last but not the least I express my thanks to all my friends for
their cooperation and support.
CONTENTS
1. System Description at a Glance
 Aim
 Files
 Input
 Output
2. Problem Description
 Requirement Analysis
 Hardware and software requirements
3. Working of the Code
 Database Design Structures
 Procedure/Function Description
4. Output/Screen Layouts
5. Source Code
6. Bibliography
SYSTEM DESCRIPTION
The “TELEPHONE DIRECTORY MANAGEMENT SYSTEM” is
broadly divided into 4 categories:

 Add a phone number


 Print a phone number
 Remove a phone number
 lookup a phone number
 Modify existing phone number
 Search by Initials

Our aim is to make a computer program which deals with the entire
process of a telephone directory and also allows the user to
modify/maintain the details after he/she has added/looked up/removed a
phone number. Each number is given a special bullet number which
helps the user to search/use it without any difficulty.
a) DATABASES: “TELEPHONE DIRECTORY” There is only one
database for storing the contact details:
b) INPUTS:
 Number given to modify/use the directory
 Number of the user/person
 Number of the person to be added
c) OUTPUT: It is a menu driven system, where

 For option 1: Prints the numbers stored/added in the directory


 For option 2: Add a phone number
 For option 3: Removes a phone number
 For option 4: Looks up a phone number
 For option 5: Modifies existing phone number
 For option 6: Exit/Quit

REQUIREMENT ANALYSIS
We have studied the existing system in detail. The findings of our study
yield various pieces of information which are described in the following
manner. For adding/looking/printing a phone number we need to enter the
following information-
o Option for what we want to do.
o Name of the person whose number is to be added.
o Name of the person whose number is to be looked up.
o Information associated to the number added.
o Printing the telephone directory list for quick access.

REQUIRED OUTPUT OF
THE SYSTEM
The computerized system generates the following reports as:
1. The system should be able to add a new number, look up an
existing one and can also remove it.
2. Record of all the numbers and names of all the people who
uses our directory and whose number are saved should be
saved.
3. Also, the handy function of printing the telephone directory
helps in quick access of the collection of data.

HARDWARE AND SOFTWARE


REQUIREMENTS
SOFTWARE-
 Operating systems: Windows* 7 or later
 Python* versions: 3.7.X or later
 All Python releases, are Open Source.
HARDWARE-
 Processors: Intel Atom® processor or Intel® Core™ i3 processor.
 Disk space: 40 GB OR ABOVE
 RAM: 512MB+
 CD/DVD r/w multi drive combo, usb pen drive. (If back up required)
 Monitor: It runs on any 80-column monitor 14.1 or 15 -17 inch.
 Key board and mouse
 Printer: (if print is required – [Hard copy])

WORKING OF THE CODE


AND LAYOUT
MAIN MENU OF DIRECTORY
FUNCTION DESCRIPTION
FUNCTIONS OPERATING IN THE DIRECTORY
No. Function Name Description

1 Print phone no  To print the existing numbers


in the directory

2 Add a number  To add a new number in the


directory

3 Remove a number  To remove an existing


number.

4 Look up a number  To search/look for a number

6 Search by initials  To search existing contacts


with initials

5 Quit  To exit the menu

PROGRAM RUN
Printing function
Add Function

Delete Function
Look Up Function

Modify Function
Search By Initials Function
SOURCE CODE
FILE NAME: TELEPHONE DIRECTORY

CODE:
import mysql.connector
mydb=mysql.connector.connect(host='localhost',user='root',password
='Ambher1512@')
cursor=mydb.cursor()
cursor.execute("create database IF NOT EXISTS tele;")
cursor.execute("use tele;")
cursor.execute("create table if not exists contacts(name
varchar(40) NOT NULL PRIMARY KEY,number int NOT NULL,email
varchar(50) DEFAULT NULL );")

print('''
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
===============================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

▄█████████████████████
██ ▐█
▄▄██▄ ▐█
▀▀██▀▀ ▄▄ ▐█
██ ██▀▀██▄ ██
██ ▐█ ██ ██
██ ██ ██ ▐█
██ ██▄ ██▄▄████ ▐█
██ ▀██▄ ▀█▌ ▐█
██ ▀██▄▄▄▄██▀ ▐█
▄▄██▄▄ ▀▀▀▀▀ ▐█
▀▀██▀ ▐█
██ ▐█
▀█████████████████████
''')
print('''
=============================
TELEPHONE DIRECTORY
=============================''')
print()
print('''
__________________________________________

--- WELCOME TO THE TELEPHONE DIRECTORY ---


__________________________________________ ''')

def print_menu():
print('''
_________________________________
█ █
█ [1] Print Phone Numbers █
█ [2] Add a Phone Number █
█ [3] Remove a Phone Number █
█ [4] Lookup by Contact Name █
█ [5] Modify existing contact █
█ [6] Search By Initials █
█ [7] Quit █
█________________________________█

''')
def numcheck(number):
cursor.execute("select * from contacts where
number={}".format(number))
temp2=cursor.fetchall()
numcheck=0
if temp2!=[]:
numcheck=1
return numcheck

def namecheck(name):
cursor.execute("select * from contacts where
name='{}'".format(name))
temp1=cursor.fetchall()
namecheck=0
if temp1!=[]:
namecheck=1
return namecheck

def check(name,number):
numcheck1=numcheck(number)
namecheck1=namecheck(name)
fin=numcheck1+namecheck1
if fin==1 or fin==2:
return 0
elif fin==0:
return 1
BIBLIOGRAPHY

1. COMPUTER SCIENCE WITH PYTHON CLASS XI, XII – BY PREETHI ARORA


2. COMPUTER SCIENCE WITH PYTHON CLASS XI, XII – BY SUMITHA ARORA
3. GEEKSFORGEEKS.ORG
4. W3SCHOOLS.COM
5. KNOWLEDGEBOAT.COM

You might also like