Question: Task # 2 ArrayLists Write a program that prints the following Menu and carries out all the functionalities: Orange Coast College Student Directory - -
Task # ArrayLists
Write a program that prints the following Menu and carries out all the functionalities:
Orange Coast College Student Directory
Add Student and Grade
Remove Student
List Students
Dean's List
Exit
Select an option:
Your program should be modularized include several methods
In the main method instantiate two ArrayLists, one for the student names and another for the student grades.
The main method contains a switch statement to call different methods. Surrounding the switch is a loop that is continuous until the user chooses to Exit. You can use a Boolean flag to accomplish this.
Include the following methods:
A method that Prints the menu. Call this method above the switch
A method that adds the students name to an ArrayList called studentNames and adds the students grade to another ArrayList named studentGrades in the corresponding position.
A method that removes a specific student by prompting the user to enter the students name to be removed.
Enter the students name to remove: Sara
If the students name is in the list; then remove them and print a confirmation message:
Sara has been removed from the list.
Otherwise, if the student is not in the list, then print:
Sara was not found in the list.
A method that lists all the students in the list and their grade.
A method that prints a list of all the student names and their grade that made the Deans list. A student can be on the Deans list if their grade is or higher.
Important Note: You will need to pass references for both ArrayLists into your methods.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
