0% found this document useful (0 votes)
2 views7 pages

OOP Lab Evaluation

The document outlines an Object-Oriented Programming (OOP) project for a password manager developed in Java. It includes details on the project objectives, features, code structure, and explanations of key classes and methods. The project allows users to add, view, and search for passwords, with proper file handling and exception management implemented.

Uploaded by

murtozapurno
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views7 pages

OOP Lab Evaluation

The document outlines an Object-Oriented Programming (OOP) project for a password manager developed in Java. It includes details on the project objectives, features, code structure, and explanations of key classes and methods. The project allows users to add, view, and search for passwords, with proper file handling and exception management implemented.

Uploaded by

murtozapurno
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

OOP PROJECT

Only for course Teacher


Needs Developing Sufficient Above Total
Improvement Average Mark
Allocate mark & Percentage 25% 50% 75% 100% 40
Understanding/Analysis 10
Implementation 15
Accuracy 10
Task Efficiency 5
Total obtained mark

Comments

Semester: Spring 2026


Student Name: 1. MD. NABID MIAH (242-35-531)
2. AKM MURTOZA BASIR SOJEEB (242-35-846)
3. TANVIR HASAN SHISHIR (242-35-798)
Batch: 43
Section: B1
Course Code: SE_217
Course Name: OBJECT ORIENTED PROGRAMMING LAB
Course Teacher Name: UTTAM KUMAR DEY
Designation: ASSISTANT PROFFESOR
Submission Date: 26/04/2026
Password Manager

Objective:
The objective of this project is to develop a simple password manager using Java.
This system allows users to store, view, and search passwords efficiently.
Theory:
This project is based on Object-Oriented Programming (OOP).
It uses class and object concepts to structure the program. Encapsulation is used to
protect data by declaring variables as [Link] handling is used to store data Ω
Features:

1. Add Password
2. View Password
3. Search Password
4. Exit
Code Explanation

Class:[Link]
Code:
package passwordmanager;
public class Main {
public static void main(String[] args) {
PasswordManager pm = new PasswordManager();
[Link]();
}
}
Explanation:
Main class is the entry point of the program.
An object of PasswordManager class is created.
The menu() method is called to start the system.
Class:[Link]
Code:
package passwordmanager;
import [Link].*;
import [Link].*;
public class PasswordManager {
private String website, username, password;
Scanner sc = new Scanner([Link]);
public void menu() {
int choice;
do {
[Link]("\n===== PASSWORD MANAGER =====");
[Link]("1. Add Password");
[Link]("2. View Passwords");
[Link]("3. Search Password");
[Link]("4. Exit");
[Link]("Enter choice: ");
choice = [Link]();
[Link]();
switch (choice) {
case 1: addPassword(); break;
case 2: viewPasswords(); break;
case 3: searchPassword(); break;
case 4: [Link]("Exiting..."); break;
default: [Link]("Invalid choice!");
}

} while (choice != 4);


}
public void addPassword() {
try {
FileWriter fw = new FileWriter([Link]("[Link]") +
"/Desktop/[Link]", true);
[Link]("Enter Website: ");
website = [Link]();
[Link]("Enter Username: ");
username = [Link]();
[Link]("Enter Password: ");
password = [Link]();
[Link](website + "," + username + "," + password + "\n");
[Link]();
[Link]("Password Saved!");
} catch (IOException e) {
[Link]("Error saving file!");
}
}
public void viewPasswords() {
try {
File file = new File("[Link]");
Scanner reader = new Scanner(file);
[Link]("\n Saved Passwords:");
while ([Link]()) {
[Link]([Link]());
}
[Link]();
} catch (Exception e) {
[Link]("No data found!");
}
}
public void searchPassword() {
[Link]("Enter website to search: ");
String search = [Link]();
try {
File file = new File("[Link]");
Scanner reader = new Scanner(file);
boolean found = false;
while ([Link]()) {
String data = [Link]();
if ([Link]().contains([Link]())) {
[Link](" Found: " + data);
found = true;
}
}
if (!found) {
[Link]("Not Found!");
}
[Link]();
} catch (Exception e) {
[Link]("Error!");
}
}
}

Explanation:

This Java program is a simple console-based Password Manager system


that allows users to store, view, and search saved login credentials. The
program is organized under the passwordmanager package and uses Java’s
Scanner class for taking user input and file handling classes from [Link] for
storing data permanently in a text file. The class PasswordManager contains
three main variables: website, username, and password, which are used to
temporarily store user input. The menu() method acts as the main controller
of the program, displaying a repeated menu using a do-while loop until the
user chooses to exit. Based on the user’s choice, it calls different methods
using a switch statement.

The addPassword() method collects website, username, and password from


the user and saves them into a file named [Link] located on the
desktop. It uses FileWriter in append mode so that new data is added without
deleting previous records. The viewPasswords() method reads the file line
by line using a Scanner and displays all stored credentials on the screen.
The searchPassword() method allows the user to search for a specific
website by reading the file and checking each line using a case-insensitive
comparison. If a match is found, it displays the corresponding data;
otherwise, it shows a “Not Found” message. Proper exception handling using
try-catch blocks is implemented throughout the program to handle file-related
errors safely without crashing the application. Overall, this project
demonstrates basic file handling, user input processing, and control flow in
Java to build a simple but functional password management system.

Output:

run:

===== PASSWORD MANAGER =====


1. Add Password
2. View Passwords
3. Search Password
4. Exit
Enter choice: 1
Enter Website: facebook
Enter Username: Nabid_531
Enter Password: 13579
Password Saved!

===== PASSWORD MANAGER =====


1. Add Password
2. View Passwords
3. Search Password
4. Exit
Enter choice: 2

Saved Passwords:
facebook,nabid,123

===== PASSWORD MANAGER =====


1. Add Password
2. View Passwords
3. Search Password
4. Exit
Enter choice: 3
Enter website to search: facebook
Found: facebook,nabid,123

===== PASSWORD MANAGER =====


1. Add Password
2. View Passwords
3. Search Password
4. Exit
Enter choice: 4
Exiting...
BUILD SUCCESSFUL (total time: 41 seconds)

Explanation:

This output shows the working flow of a console-based Password Manager


system. First, the program displays a menu where the user selects option 1
to add a new password. The system takes website, username, and password
as input and stores them in a file, confirming with “Password Saved!”. Next,
the user chooses option 2 to view all saved data, and the program reads and
displays the stored credentials from the file. Then, option 3 is used to search
for a specific website; when “facebook” is entered, the program successfully
finds and displays the matching record. Finally, option 4 exits the program
with a “Exiting...” message. Overall, this demonstrates successful add, view,
search, and exit operations in the system.

You might also like