You can now add the following functionality to your application:

1. The users should only be able to add tasks to the application if they have logged in successfully.
2. The applications must display the following welcome message: “Welcome to EasyKanban”.
3. The user should then be able to choose one of the following features from a numeric menu:
a. Option 1) Add tasks
b. Option 2) Show report - this feature is still in development and should display the following message: “Coming Soon”.
c. Option 3) Quit

4. The application should run until the users selects quit to exit.
5. Users should define how many tasks they wish to enter when the application starts, the
application should allow the user to enter only the set number of tasks.
6. Each task should contain the following information:
Task Name : The name of the task to be performed: “Add
Login Feature”

Task Number : Tasks start with the number 0, this number is
incremented and autogenerated as more tasks are added .

Task Description: A short description of the task, this description
should not exceed 50 characters in length.
The following error message should be
displayed if the task description is too long:
“Please enter a task description of less than
50 characters”
OR
“Task successfully captured” if the message
description meets the requirements.

Developer Details: The first and last name of the developer
assigned to the task.

Task Duration: The estimated duration of the task in hours.
This number will be used for calculations and
should make use of an appropriate data type.

Task ID : The system must autogenerate a TaskID which
contains the first two letters of the Task
Name, a colon (:), the Task Number, a colon (:)
and the last three letters of the developer assigned to the task’s name. The ID should be displayed in all caps:
AD:0:INA

Task Status : The user should be given a menu to select the
following task statuses from:
• To Do
• Done
• Doing

7. The full details of each task should be displayed on the screen (using JOptionPane) after it has been entered and should show all the information requested in the table above in the following order: Task Status, Developer Details, Task Number, Task Name, Task Description, Task ID and Duration;
8. The total number of hours across all tasks should be accumulated and displayed once all the tasks has been entered.
Create a Task class that contains the following messages:
Method Name : Boolean: checkTaskDescription()
Method Functionality: this method ensures that the task description
is not more than 50 characters.

Method Name : String: createTaskID()
Method Functionality: This method creates and returns the taskID

Method Name : String: printTaskDetails()
Method Functionality: This method returns the task full task details
of each task.

Method Name : Int: returnTotalHours()
Method Functionality: This method returns the total combined hours
of all entered tasks.

You will now add the final features to your app , write and automate the unit tests and submit
your final project. Extend your application to allow for the following:
1. Users should be able to use to populate the following arrays:
Array: Contents
Developer : Contains the names of all the developers
assigned to tasks
Task Names : Contains the names of all the created tasks
Task ID: Contains the generated taskID’s for all tasks
Task Duration : Contains the Duration of all tasks
Task Status: Contains the Status of all tasks
2. Users should be able to use these arrays to:
a. Display the Developer, Task Names and Task Duration for all tasks with the status of done.
b. Display the Developer and Duration of the class with the longest duration.
c. Search for a task with a Task Name and display the Task Name, Developer and Task Status.
d. Search for all tasks assigned to a developer and display the Task Name and Task Status.
e. Delete a task using the Task Name.
f. Display a report that lists the full details of all captured tasks.

in java

1 answer

Sure! Here's an example implementation in Java:

```java
import java.util.*;

public class EasyKanban {
private static ArrayList<String> developers = new ArrayList<>();
private static ArrayList<String> taskNames = new ArrayList<>();
private static ArrayList<String> taskIDs = new ArrayList<>();
private static ArrayList<Integer> taskDurations = new ArrayList<>();
private static ArrayList<String> taskStatuses = new ArrayList<>();

private static int totalHours = 0;

public static void main(String[] args) {
boolean loggedIn = false;
String username = "";

System.out.println("Welcome to EasyKanban");

// Login functionality
Scanner scanner = new Scanner(System.in);
while (!loggedIn) {
System.out.println("Enter your username: ");
username = scanner.nextLine();

// Check if user exists in database or authentication system
// ...

loggedIn = true; // Assuming login is successful
}

// Main menu
int choice;
do {
System.out.println("\nMAIN MENU");
System.out.println("1) Add tasks");
System.out.println("2) Show report");
System.out.println("3) Quit");
System.out.println("Enter your choice: ");

choice = scanner.nextInt();
scanner.nextLine(); // Consume newline character

switch (choice) {
case 1:
System.out.println("Enter the number of tasks you wish to enter: ");
int numTasks = scanner.nextInt();
scanner.nextLine();

for (int i = 1; i <= numTasks; i++) {
addTask(scanner, i);
}
break;
case 2:
System.out.println("COMING SOON");
break;
case 3:
System.out.println("Exiting...");
break;
default:
System.out.println("Invalid choice. Please try again.");
break;
}
} while (choice != 3);

scanner.close();
}

public static void addTask(Scanner scanner, int taskNumber) {
System.out.println("\nTASK " + taskNumber);
System.out.print("Task Name: ");
String taskName = scanner.nextLine();

System.out.print("Task Description: ");
String taskDescription = scanner.nextLine();

// Check task description length
boolean validDescription = checkTaskDescription(taskDescription);

System.out.print("Developer First Name: ");
String devFirstName = scanner.nextLine();

System.out.print("Developer Last Name: ");
String devLastName = scanner.nextLine();

String developerDetails = devFirstName + " " + devLastName;

System.out.print("Task Duration (in hours): ");
int taskDuration = scanner.nextInt();
scanner.nextLine();

String taskID = createTaskID(taskName, taskNumber, devLastName);

System.out.println("Task Status:");
System.out.println("1) To Do");
System.out.println("2) Done");
System.out.println("3) Doing");
System.out.print("Enter your choice: ");
int statusChoice = scanner.nextInt();
scanner.nextLine();

String taskStatus = "";
switch (statusChoice) {
case 1:
taskStatus = "To Do";
break;
case 2:
taskStatus = "Done";
break;
case 3:
taskStatus = "Doing";
break;
default:
taskStatus = "To Do";
break;
}

if (validDescription) {
System.out.println("\nTask successfully captured.");
} else {
System.out.println("\nPlease enter a task description of less than 50 characters.");
}

taskNames.add(taskName);
developers.add(developerDetails);
taskDurations.add(taskDuration);
taskIDs.add(taskID);
taskStatuses.add(taskStatus);

totalHours += taskDuration;

System.out.println("\nTask Details:");
System.out.println("Task Status: " + taskStatus);
System.out.println("Developer Details: " + developerDetails);
System.out.println("Task Number: " + taskNumber);
System.out.println("Task Name: " + taskName);
System.out.println("Task Description: " + taskDescription);
System.out.println("Task ID: " + taskID);
System.out.println("Task Duration: " + taskDuration + " hours");
}

public static boolean checkTaskDescription(String taskDescription) {
return taskDescription.length() <= 50;
}

public static String createTaskID(String taskName, int taskNumber, String devLastName) {
String taskID = taskName.substring(0, 2) + ":" + taskNumber + ":" + devLastName.substring(devLastName.length() - 3);
return taskID.toUpperCase();
}

public static void displayDoneTasks() {
for (int i = 0; i < taskNames.size(); i++) {
if (taskStatuses.get(i).equals("Done")) {
System.out.println("Developer: " + developers.get(i));
System.out.println("Task Name: " + taskNames.get(i));
System.out.println("Task Duration: " + taskDurations.get(i) + " hours");
System.out.println("-------------------------------");
}
}
}

public static void displayLongestTask() {
int maxDuration = 0;
int maxDurationIndex = -1;

for (int i = 0; i < taskNames.size(); i++) {
if (taskDurations.get(i) > maxDuration) {
maxDuration = taskDurations.get(i);
maxDurationIndex = i;
}
}

if (maxDurationIndex != -1) {
System.out.println("Developer: " + developers.get(maxDurationIndex));
System.out.println("Task Duration: " + maxDuration + " hours");
}
}

public static void searchTaskByName(String taskName) {
boolean found = false;

for (int i = 0; i < taskNames.size(); i++) {
if (taskNames.get(i).equalsIgnoreCase(taskName)) {
System.out.println("Task Name: " + taskNames.get(i));
System.out.println("Developer: " + developers.get(i));
System.out.println("Task Status: " + taskStatuses.get(i));
found = true;
break;
}
}

if (!found) {
System.out.println("Task not found.");
}
}

public static void searchTaskByDeveloper(String developerName) {
boolean found = false;

for (int i = 0; i < taskNames.size(); i++) {
if (developers.get(i).equalsIgnoreCase(developerName)) {
System.out.println("Task Name: " + taskNames.get(i));
System.out.println("Task Status: " + taskStatuses.get(i));
found = true;
}
}

if (!found) {
System.out.println("No tasks assigned to this developer.");
}
}

public static void deleteTaskByName(String taskName) {
boolean found = false;

for (int i = 0; i < taskNames.size(); i++) {
if (taskNames.get(i).equalsIgnoreCase(taskName)) {
taskNames.remove(i);
developers.remove(i);
taskDurations.remove(i);
taskIDs.remove(i);
taskStatuses.remove(i);
found = true;
break;
}
}

if (!found) {
System.out.println("Task not found.");
} else {
System.out.println("Task deleted successfully.");
}
}

public static void displayTaskReport() {
for (int i = 0; i < taskNames.size(); i++) {
System.out.println("Task Status: " + taskStatuses.get(i));
System.out.println("Developer Details: " + developers.get(i));
System.out.println("Task Number: " + (i + 1));
System.out.println("Task Name: " + taskNames.get(i));
System.out.println("Task Description: " + taskDescriptions.get(i));
System.out.println("Task ID: " + taskIDs.get(i));
System.out.println("Task Duration: " + taskDurations.get(i) + " hours");
System.out.println("-------------------------------");
}
}

public static int returnTotalHours() {
return totalHours;
}
}
```

Please note that this is just a basic implementation to demonstrate the functionality mentioned in the requirements. You can further enhance and optimize the code as per your specific needs.