Question: - DriverMain.java: - Solution.java: DO NOT CHANGE THE DriverMain.java file! Code only where specified! HW3_P1 - Student list using array Given a Student class, create

 - DriverMain.java: - Solution.java: DO NOT CHANGE THE DriverMain.java file! Code

- DriverMain.java:

only where specified! HW3_P1 - Student list using array Given a Student

- Solution.java:

class, create a class with following characteristics: The class name should be

DO NOT CHANGE THE DriverMain.java file! Code only where specified!

HW3_P1 - Student list using array Given a Student class, create a class with following characteristics: The class name should be Classroom. Private variable students array to maintain the list of Student objects. Function addStudent with input parameter name (string) and rolloint) adds a new student in "students" list. Method getAllStudents should return all the students in Classroom. Input Jack 1 Jones 2 Marry 3 where, First & Second line represent a student's name and roll number. And so on. Output 1 - Jack 2 - Jones 3 - Marry Assume that, Maximum "students" count can be 10. 9 1 import java.util.*; 2 3 public class DriverMain { public static void main(String[] args) { 5 String name; int rollno; 7 int n = 0; Student[] students = new Student[10]; classroom classroom = new classroom(); 10 Scanner input = new Scanner(System.in); while(true) { 12 try name = input.nextLine(); 14 rollno = Integer.parseInt(input.nextLine()); 15 } catch (Exception e) { 16 break; 17 } 18 if(name.equals("")) 19 break; 11 13 20 21 classroom.addStudent (name, rollNo); 22 n++; 23 24 25 26 } students = classroom.getAllStudents(); for (int i = 0; i

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 Databases Questions!