Professional Documents
Culture Documents
Report On
Mini-Telephone Directory
SUBMITTED BY:
2200032865 SOWMYA
2200033008 MEGHANA
2200033055 BASIVIREDDY
2200033060 TEJASWI
KL UNIVERSITY
Green fields, Vaddeswaram – 522 502
Guntur Dt., AP, India.
I
DEPARTMENT OF BASIC ENGINEERING SCIENCES
CERTIFICATE
This is to certify that the project based laboratory report entitled “MINI-TELEPHONE DIRECTORY”
submitted by Sowmya(2200032865), Meghana(2200033008), basivireddy(2200033055),
Tejaswi(2200033060)to the Department of Basic Engineering Sciences, KL University in partial
fulfillment of the requirements for the completion of a project in “Object Oriented Programming”
course in I B Tech II Semester, is a Bonafede record of the work carried out by Mrs. G. Rajini
Reddy under my supervision during the academic year 2022-23
II
ACKNOWLEDGEMENTS
I express the sincere gratitude to our director Dr. A Jagadeesh for his administration
towards our academic growth.
I express sincere gratitude to our Coordinator Dr. V. Krishna Reddy and HOD-BES
Dr. D. Haritha for her leadership and constant motivation provided in successful completion
of our academic semester. I record it as my privilege to deeply thank for providing us the
efficient faculty and facilities to make our ideas into reality.
I express my sincere thanks to our project supervisor Mrs. RAJINI REDDY for
his/her novel association of ideas, encouragement, appreciation and intellectual zeal which
motivated us to venture this project successfully.
Project Associates
2200032865 SOWMYA
2200033008 MEGHANA
2200033055 BASIVIREDDY
2200033060 TEJASWI
III
ABSTRACT
The advent of the internet and smart phones in the 21st century greatly reduced the need
for a paper phone book. Some communities, such as Seattle and San Francisco, soughtto ban
their unsolicited distribution as wasteful, unwanted and harmful to the environment.
1996 was the year the first telephone directories went online in the USA.
Yellowpages.com and Whitepages.com both saw their start in April. In 1999, the first online
telephone directories and people-finding sites such as LookUK.com went online in UK. In
2003, more advanced UK searching including Electoral Roll became available on
LocateFirst.com in the 21st century, printed telephone directories are increasingly criticized as
waste. In 2012, after some North American cities passed laws banning the distribution of
telephone books, an industry group sued and obtained a court ruling permitting the distribution
to continue.
IV
INDEX
1 Introduction 1-2
4 Class Diagram 5
5 Implementation 6-8
6 Outputs/Screenshots 9
7 Conclusion 10
V
INTRODUCTION
Class:
A class is a user defined blueprint or prototype from which objects are created. It
represents the set of properties or methods that are common to all objects of one type.
Methods:
A method is a collection of statements that perform some specific task and return the
result to the caller. A method can perform some specific task without returning anything.
Methods allow us to reuse the code without retyping the code. In Java, every method must be
part of some class which is different from languages like C, C++, and Python. Methods
are time savers and help us to reuse the code without retyping the code.
Objects:
It is a basic unit of Object-Oriented Programming and represents the real-life entities.
Hash Table:
This class implements a hash table, which maps keys to values. Any non-null object can be
used as a key or as a value. To successfully store and retrieve objects from a hash table, the
objects used as keys must implement the hash Code method and the equals method. It is like
HashMap but is synchronized. Hash table stores key/value pair in hash table.
In Hash table we specify an object that is used as a key, and the value we want to
associate to that key. The key is then hashed, and the resulting hash code is used as the index
at which the value is stored within the table.
1
Inheritance:
Inheritance is a mechanism in which one object acquires all the properties and
behaviors of a parent object. It is an important part of OOPs (Object Oriented programming
system). The idea behind inheritance is that you can create new
classes that are built upon existing classes.
Constructers:
Constructors are used to initialize the object’s state. Like methods, a constructor also
contains collection of statements that are executed at time of Object creation.
Abstract class:
An abstract class is a class that is declared abstract —it may or may not
include abstract methods. Abstract classes cannot be instantiated, but they can be subclass.
When an abstract class is subclass, the subclass usually provides implementations for all of
the abstract methods in its parent.
2
AIM
You are going to Create a Mini- Telephone Directory App. Develop a Mini Telephone Directory
based on user interface using Hash Table it adds contacts, display all contacts, search contacts
using name or number. All the options will we displayed when users try to interact with it.
Limitations: -
Drawbacks: -
• The main disadvantage of reverse phone directory is that, anyone who possesses your
cell number can easily look up to all personal details.
• Sometimes the information which is provided turns out to be the incorrect data.
• In case you own a cell number or an unlisted number, still the phone book companies
can list your all-personal information such as name, address, your email is etc.
• Also, it seen that there is irregular maintenance of the existing numbers.
Future Implementation: -
The next generation contact management solution needs to provide a few basic
services: portability, security, and syndication. There is a legitimate need for security and it
would be nice to be able to determine who can see your information and who can’t.
Yet we should also acknowledge the absolute security of contact data is quite
impossible for most of unless we spend a lot of money and time that we don’t have to secure
it. Finally, it should be so easy to use as a existing contact book or application that you use
today.
3
SOFTWARE & HARDWARE REQUIREMENTS:
➢ SOFTWARE REQUIREMENTS:
The major software requirements of the project are as follows:
Language : Java
Operating system: Windows Xp or later.
➢ HARDWARE REQUIREMENTS:
The hardware requirements that map towards the software are as follows:
RAM : 8 GB
Processor : i5 processor
4
CLASS DIAGRAM
5
IMPLEMENTATION:
package Java;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
public PhoneDirectoryGUI() {
// Create directory
directory = new HashMap<>();
// Create frame
6
frame = new JFrame("Phone Directory");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Create panel
panel = new JPanel(new FlowLayout());
7
lookupButton.addActionListener(this);
panel.add(lookupButton);
// Display frame
frame.pack();
SetSize(400,400);
frame.setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == addButton) {
addContact();
8
} else if (e.getSource() == deleteButton) {
deleteContact();
} else if (e.getSource() == lookupButton) {
lookupContact();
}
}
if (name.isEmpty() || phone.isEmpty()) {
JOptionPane.showMessageDialog(frame, "Name and
phone number are required.");
return;
}
if (directory.containsKey(name)) {
JOptionPane.showMessageDialog(frame, "Contact
already exists.");
return;
}
directory.put(name, phone);
JOptionPane.showMessageDialog(frame, "Contact added:
" + name + " (" + phone + ")");
nameField.setText("");
phoneField.setText("");
}
if (name.isEmpty()) {
JOptionPane.showMessageDialog(frame, "Name is
required.");
return;
}
nameField.setText("");
phoneField.setText("");
}
if (name.isEmpty()) {
JOptionPane.showMessageDialog(frame, "Name is
required.");
return;
}
10
String phone = directory.get(name);
if (phone == null) {
JOptionPane.showMessageDialog(frame, "Contact not
found.");
} else {
JOptionPane.showMessageDialog(frame, "Phone
number for " + name + ": " + phone);
}
nameField.setText("");
phoneField.setText("");
}
}
11
OUTPUTS/SCREENSHOTS
12
13
CONCLUSION:
14