0% found this document useful (0 votes)
3 views

Java Mini Project

The document outlines the design of a personal task manager application that enables users to efficiently manage their tasks through a console-based interface. It includes functionalities for adding, removing, and displaying tasks, utilizing a Task class and a TaskManager class to handle data management. The program features a menu-driven interface and incorporates basic CRUD operations, error handling, and dynamic data storage using an ArrayList.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Java Mini Project

The document outlines the design of a personal task manager application that enables users to efficiently manage their tasks through a console-based interface. It includes functionalities for adding, removing, and displaying tasks, utilizing a Task class and a TaskManager class to handle data management. The program features a menu-driven interface and incorporates basic CRUD operations, error handling, and dynamic data storage using an ArrayList.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 4

Problem Statement:

In today's fast-paced life, managing tasks efficiently is crucial for productivity. A


personal task manager application is designed to allow users to organize and
manage their tasks in a simple and effective way. The application will allow users to
add new tasks, view existing tasks, and remove completed tasks. This will help
individuals stay organized and keep track of their daily, weekly, or long-term goals.

Methodology:
User Interface (UI):

The application is console-based.

A simple menu will be displayed, offering users the following options:

Add a new task.

Remove an existing task.

View all tasks.

Exit the application.

Data Management:

A Task class will store the task name and its description.

The TaskManager class will maintain a collection of tasks using a list (ArrayList). This
class will handle the operations of adding, removing, and displaying tasks.

Basic CRUD Operations:

Add Task: When the user chooses to add a task, they will be prompted to input the
task's name and description. The new task will then be added to the list.

Remove Task: The user can remove a task by specifying its name. If the task is
found, it will be removed from the list.

Display Tasks: This will display all tasks currently in the list, showing both the name
and description of each task.

Exit: The program will terminate.

Data Structure:

The TaskManager class will use an ArrayList to store the tasks. This will allow easy
addition and removal of tasks, as ArrayLists are dynamic in size and easy to
manipulate.

Flow of the Program:

The user will interact with the system through a menu-driven interface.

The program will keep running until the user chooses to exit.

Error handling will be included to deal with invalid inputs or attempts to remove a
non-existing task.

Algorithm:
Start the program.

Display the menu:

Show options for adding a task, removing a task, displaying tasks, and exiting.

Process User Input:

If the user chooses to add a task:

Prompt the user for the task name.

Prompt the user for the task description.

Create a new task and add it to the task list.

If the user chooses to remove a task:

Prompt the user for the task name to remove.

Search for the task by its name.

If found, remove the task and confirm the removal.

If not found, notify the user that the task does not exist.

If the user chooses to display tasks:

Print all tasks in the list, displaying their names and descriptions.

If the user chooses to exit:


Exit the program.

Repeat the menu display until the user chooses to exit.

End the program.

Code
import java.util.Date;

public class Task {

private String taskName;

private String description;

private String priority;

private Date deadline;

private boolean isCompleted;

// Constructor

public Task(String taskName, String description, String priority, Date deadline) {

this.taskName = taskName;

this.description = description;

this.priority = priority;

this.deadline = deadline;

this.isCompleted = false;

public String getTaskName() {

return taskName;

public String getDescription() {


return description;

public String getPriority() {

return priority;

public Date getDeadline() {

return deadline;

public boolean isCompleted() {

return isCompleted;

public void markCompleted() {

this.isCompleted = true;

@Override

public String toString() {

return "Task Name: " + taskName + "\nDescription: " + description + "\nPriority: " + priority
+

"\nDeadline: " + deadline + "\nCompleted: " + (isCompleted ? "Yes" : "No") + "\n";

You might also like