Write java application of

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:
21; 22; 23 2023
© The Independent Institute of Education (Pty) Ltd 2023 Page 10 of 22
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

1 answer

import java.util.Scanner;

public class EasyKanban {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Welcome to EasyKanban");

// login feature
boolean isLoggedIn = false;
while (!isLoggedIn) {
System.out.println("Please log in to continue");
System.out.print("Username: ");
String username = input.nextLine();
System.out.print("Password: ");
String password = input.nextLine();
if (validateLogin(username, password)) {
System.out.println("Login successful!\n");
isLoggedIn = true;
} else {
System.out.println("Invalid username or password, please try again.\n");
}
}

// menu options
int numTasks = 0;
boolean quit = false;
while (!quit) {
System.out.println("Please choose an option from the menu:\n" +
"1) Add tasks\n" +
"2) Show report\n" +
"3) Quit");
int choice = input.nextInt();
input.nextLine(); // clear scanner buffer
switch (choice) {
case 1:
System.out.print("Enter the number of tasks you wish to add: ");
numTasks = input.nextInt();
input.nextLine(); // clear scanner buffer
addTasks(numTasks, input);
break;
case 2:
System.out.println("Coming soon");
break;
case 3:
System.out.println("Goodbye!");
quit = true;
break;
default:
System.out.println("Invalid choice, please try again.\n");
break;
}
}
}

// method to validate user login
public static boolean validateLogin(String username, String password) {
// put your login validation logic here
return true;
}

// method to add tasks
public static void addTasks(int numTasks, Scanner input) {
for (int i = 0; i < numTasks; i++) {
System.out.print("Task Name: ");
String taskName = input.nextLine();
String taskNum = Integer.toString(i);
System.out.print("Task Description: ");
String taskDesc = input.nextLine();
if (taskDesc.length() > 50) {
System.out.println("Please enter a task description of less than 50 characters");
i--; // decrement counter to redo current task
continue;
}
System.out.print("Developer First Name: ");
String devFirstName = input.nextLine();
System.out.print("Developer Last Name: ");
String devLastName = input.nextLine();
System.out.print("Task Duration (hours): ");
int taskDuration = input.nextInt();
input.nextLine(); // clear scanner buffer
String taskID = taskName.substring(0,2) + ":" + taskNum + ":" + devLastName.substring(devLastName.length()-3);
System.out.println("Task successfully captured\n" +
"Task ID: " + taskID + "\n");
}
}
}
Similar Questions
  1. You can now add the following functionality to your application:1. The users should only be able to add tasks to the application
    1. answers icon 1 answer
  2. I need to create a pseudocode for the follwing application:Write Java-like pseudocode to specify the logic for the following
    1. answers icon 0 answers
    1. answers icon 3 answers
  3. Write a small parapgraph of objective for the following:This is an RTOS based application. That is developing an embedded
    1. answers icon 3 answers
more similar questions