Professional Documents
Culture Documents
SUBMITTED BY:
NAME: KRUTIK.R
ROLL NO: 17
CLASS: XII-G
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:
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
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.
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('''
__________________________________________
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