Question: Write the code for a method called createArray ) that will return an array of Student objects.This method will prompt the user to provide data
Write the code for a method called createArray that will return an array of Student objects.This method will prompt the user to provide data via keyboard input to create an array of Student objects Initialize the Array: Create an array to hold Student objects Outer Loop for Students: Use an outer loop to iterate times, once for each Student object Nested Loop for Grades: For each Student object, create a new ArrayList of Double to hold the grades. Use a nested loop to prompt the user to enter each grade and add it to the ArrayList.The number of grades can vary for each student Assigning Student Objects: After collecting the grades for a student, create the Student object using the collected data. Place the Student object in the appropriate position in the array of Student objects Return the Array: At the end of the method, return the array of Student objects.
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
