create java application
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;
7. 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
Method Functionality
Boolean: checkTaskDescription()
This method ensures that the task description is not more than 50 characters.
String: createTaskID()
This method creates and returns the taskID
String: printTaskDetails()
This method returns the task full task details of each task.
Int: returnTotalHours()
This method returns the total combined hours of all entered tasks.
21; 22; 23 2023
© The Independent Institute of Education (Pty) Ltd 2023 Page 12 of 22
8. Please use the following the following test data to create unit tests.
Test Data:
Num Tasks
2
Test Data for Task 1
Task Name
“Login Feature”
Task Number
Auto generated.
Task Description
“Create Login to authenticate users”
Developer Details
Robyn Harrison
Task Duration
8hrs
TaskID
Auto generated
Task Status
To Do
Test Data for Task 2
Task Name
“Add Task Feature”
Task Number
Auto generated.
Task Description
“Create Add Task feature to add task users”
Developer Details
Mike Smith
Task Duration
10hrs
TaskID
Auto generated
Task Status
Doing
9. Create the following unit tests:
Test AssertEquals:
Task Description should not be more than 50 Characters
Test for both success and failure
The system should return:
Success
“Task successfully captured”
Failure:
“Please enter a task description of less than 50 characters”
21; 22; 23 2023
© The Independent Institute of Education (Pty) Ltd 2023 Page 13 of 22
TaskID is correct
The system should return:
AD:1:BYN When supplied with the data from Test case 1
The system should test the remainder of the TaksIDs in a loop (refer to video):
CR:0:IKE, CR:1:ARD, CR:2:THA, CR:3:ND
Total Hours Correctly accumulated in loop
Additional test data:
1)Test Data for Task1 and Task2.
2: Num Tasks: 5, Durations: 10,12,55,11,1
The system should return:
1) 18 on the last iteration of the loop
2) 89 for the additional data
1 answer
To create a Java application for the given requirements, you can follow the following steps:
1. Create a Task class that contains the required attributes and methods mentioned in the question (checkTaskDescription(), createTaskID(), printTaskDetails() and returnTotalHours()).
2. Create a TaskManager class that will handle all the functionalities related to adding, displaying, and calculating the total duration of tasks.
3. Use JOptionPane to display input dialogs for entering the details of each task and show the task details in output dialogs.
4. Implement the checkTaskDescription() method to verify that the task description is less than 50 characters.
5. Implement the createTaskID() method to generate the task ID in the required format.
6. Implement the printTaskDetails() method to return the full details of each task in the required order.
7. Implement the returnTotalHours() method to calculate the total duration of all tasks entered.
8. Write unit tests for the Task class to verify the correctness of checkTaskDescription() method and createTaskID() method.
9. Write unit tests for TaskManager class to test if the task details are displayed correctly, and the total duration is calculated correctly.
I hope this helps!