Question: Question 1 [ 3 3 marks ] ArrayList is preferable when the application requires frequent random access to elements or relies heavily on index -

Question 1
[33 marks]
ArrayList is preferable when the application requires frequent random access to elements or relies heavily on index-based operations. In this question, you are required to create a program that handles a list of tasks for a project using an ArrayList. Each task is described by a string. Use Swing controls and event listeners to create a GUI that will insert/add tasks, view tasks in the console, and remove/delete tasks.
(33 marks)
Example:
Task Management Application
Tasks
Clean the house
Task Index
Console
Jutput - Formative-Assessment2(run)
run :
Tasks:
Wash the dishes
Cut the grass
Clean the house
Delete the task using the task index number:
Task Management Application
Tasks:
Wash the dishes
Cut the grass
Clean the house
Task 3 removed successfully!
Wash the dishes
Cut the grass
\table[[Criteria,Function,Marks],[GUI Design.,\table[[Layout: Is the GUI layout],[intuitive and visually],[appealing?]],8 marks],[,\table[[(3 marks)],[Components: Are],[appropriate Swing],[components used for task],[insertion, viewing, and],[removal?(5 marks)]],]]
\table[[Functionality.,\table[[Task Insertion: Does the],[program successfully],[insert/add tasks to the],[ArrayList when triggered by],[the GUI? (5 marks)],[Task Viewing: Does the],[program correctly display],[tasks in the console when],[triggered by the GUI? (5],[marks)],[Task Removal: Does the],[program successfully],[remove/delete tasks from the],[ArrayList when triggered by],[the GUI? (5 marks)]],15 marks],[Event Handling.,\table[[Event Handling: Is event],[handling implemented],[correctly to perform the],[desired tasks (insertion,],[viewing, removal) based on],[user actions?]],10 marks]]
Question 2
[17 marks]
Create a Java method called recursivePower. This method should calculate the power of a given base number raised to an exponent using recursion. The method must accept two integer parameters: base and exponent. Your implementation should handle both positive and negative exponents. In other words, it should compute the result of the base raised to the power of exponent recursively.
(17 marks)
Question 1 [ 3 3 marks ] ArrayList is preferable

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!