Computer Science Part 2: Client Program with ArrayList Create a second client program. This program will contain an ArrayList of StudentGrades objects. The program will perform the following tasks: Create an instance of an ArrayList that will store three StudentGrades objects. Each element in the ArrayList represents student grades for a test (assessment). This means that each StudentGrades object stored by the ArrayList element represents the grades achieved by students for a single test. Prompt the user for the number of students in the class. The prompt text is: Enter the number of students in the course: [Keyboard Input] Add three new StudentGrades objects to the ArrayList. The StudentGrades objects should be populated with random values from 0 to 100. Use the enhanced for loop to print each of the StudentGrades objects to the console. Print a line containing the following text: “LAST ELEMENT BEFORE REMOVE:”. Print the value of the final element in the ArrayList under the heading. Remove the final StudentGrades objects from the ArrayList. Print a line containing the following text: “LAST ELEMENT AFTER REMOVE:”. Trim the ArrayList and print the value of the final element in the ArrayList under the heading. please code in java

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question

Computer Science

Part 2: Client Program with ArrayList Create a second client program. This program will contain an ArrayList of StudentGrades objects. The program will perform the following tasks: Create an instance of an ArrayList that will store three StudentGrades objects. Each element in the ArrayList represents student grades for a test (assessment). This means that each StudentGrades object stored by the ArrayList element represents the grades achieved by students for a single test. Prompt the user for the number of students in the class. The prompt text is: Enter the number of students in the course: [Keyboard Input] Add three new StudentGrades objects to the ArrayList. The StudentGrades objects should be populated with random values from 0 to 100. Use the enhanced for loop to print each of the StudentGrades objects to the console. Print a line containing the following text: “LAST ELEMENT BEFORE REMOVE:”. Print the value of the final element in the ArrayList under the heading. Remove the final StudentGrades objects from the ArrayList. Print a line containing the following text: “LAST ELEMENT AFTER REMOVE:”. Trim the ArrayList and print the value of the final element in the ArrayList under the heading.

please code in java 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage