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

Java Project

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Java Project

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

ABSTRACT

A simple task manager in Java is a software application designed to help users efficiently organize and

manage their tasks. This program typically features a user-friendly interface where individuals can create,

edit, and delete tasks, as well as set deadlines and priorities. Utilizing Java's object-oriented programming

principles, the task manager can implement classes to represent tasks, users, and categories, ensuring a

modular and maintainable code structure.

The task manager may also include functionalities such as sorting tasks by priority or deadline, filtering

completed tasks, and providing reminders for upcoming deadlines. By leveraging Java's built-in data

structures, such as ArrayLists or HashMaps, the application can efficiently store and retrieve tasks.

Additionally, the program can be enhanced with file I/O capabilities, allowing users to save their tasks to a

file and load them upon restarting the application.

Overall, a simple task manager in Java serves as an effective tool for personal productivity, helping users

stay organized and focused on their goals. Its development not only showcases Java's versatility but also

provides valuable experience in software design and user interface development.

1
INTRODUCTION

A simple task manager in Java is a practical application that allows users to efficiently organize and
track their tasks. It serves as a digital assistant, helping individuals prioritize their responsibilities and
manage their time effectively. With its straightforward design, the task manager enables users to
create, edit, and delete tasks, making it easy to adapt to changing priorities.

The application typically features a user-friendly interface that displays tasks in a clear and organized
manner. Users can categorize tasks, set deadlines, and assign priorities, which enhances productivity
and ensures that important tasks are not overlooked. By utilizing Java's object-oriented programming
capabilities, the task manager can be structured to maintain modularity and ease of maintenance.

Additionally, the task manager can incorporate features such as sorting tasks by various criteria,
filtering completed tasks, and sending reminders for upcoming deadlines. This functionality not only
aids in personal organization but also provides a foundation for further enhancements, such as
integrating with calendar applications or adding a user authentication system. Overall, a simple task
manager in Java is an excellent project for developers looking to improve their programming skills
while creating a useful tool for everyday life.

2
CODE

import java.util.ArrayList;
import java.util.Scanner;

class Task {
private String description;
private boolean isCompleted;

public Task(String description) {


this.description = description;
this.isCompleted = false;
}

public String getDescription() {


return description;
}

public boolean isCompleted() {


return isCompleted;
}

public void markAsCompleted() {


this.isCompleted = true;
}

@Override
public String toString() {
return (isCompleted ? "[Completed] " : "[Pending] ") + description;
}
}

class TaskManager {

3
private ArrayList<Task> tasks = new ArrayList<>();

public void addTask(String description) {


tasks.add(new Task(description));
System.out.println("Task added.");
}

public void viewTasks() {


if (tasks.isEmpty()) {
System.out.println("No tasks available.");
return;
}
for (int i = 0; i < tasks.size(); i++) {
System.out.println((i + 1) + ". " + tasks.get(i));
}
}

public void completeTask(int index) {


if (index < 1 || index > tasks.size()) {
System.out.println("Invalid task number.");
return;
}
tasks.get(index - 1).markAsCompleted();
System.out.println("Task marked as completed.");
}

public void deleteTask(int index) {


if (index < 1 || index > tasks.size()) {
System.out.println("Invalid task number.");
return;
}
tasks.remove(index - 1);
System.out.println("Task deleted.");
}
}

4
public class SimpleTaskManager {
public static void main(String[] args) {
TaskManager taskManager = new TaskManager();
Scanner scanner = new Scanner(System.in);

while (true) {
System.out.println("\nTask Manager:");
System.out.println("1. Add Task");
System.out.println("2. View Tasks");
System.out.println("3. Complete Task");
System.out.println("4. Delete Task");
System.out.println("5. Exit");
System.out.print("Choose an option: ");
int choice = scanner.nextInt();
scanner.nextLine(); // Consume newline

switch (choice) {
case 1:
System.out.print("Enter task description: ");
String description = scanner.nextLine();
taskManager.addTask(description);
break;
case 2:
System.out.println("Task List:");
taskManager.viewTasks();
break;
case 3:
System.out.print("Enter task number to complete: ");
int completeIndex = scanner.nextInt();
taskManager.completeTask(completeIndex);
break;
case 4:
System.out.print("Enter task number to delete: ");
int deleteIndex = scanner.nextInt();

5
taskManager.deleteTask(deleteIndex);
break;
case 5:
System.out.println("Exiting Task Manager.");
scanner.close();
return;
default:
System.out.println("Invalid option. Please try again.");
}
}
}
}

6
7
CONCLUSION

A simple task manager is a tool designed to help individuals organize and keep track of their tasks
efficiently. It typically includes features such as task creation, prioritization, deadlines, and status updates.
The main benefits of using a simple task manager are improved productivity, reduced stress, and enhanced
focus. By breaking tasks into manageable parts and keeping everything in one place, users can easily
monitor their progress and stay organized. Overall, a simple task manager serves as an effective way to
manage daily responsibilities and achieve goals more systematically.

A simple task manager is a tool designed to help individuals organize and keep track of their tasks
efficiently. It typically includes features such as task creation, prioritization, deadlines, and status updates.
The main benefits of using a simple task manager are improved productivity, reduced stress, and enhanced
focus. By breaking tasks into manageable parts and keeping everything in one place, users can easily
monitor their progress and stay organized. Overall, a simple task manager serves as an effective way to
manage daily responsibilities and achieve goals more systematically.

8
9

You might also like