In Java create ArrayList Students from replit
The objective of this program is to create a roster of students
and then determine how many are in each of the four high school
grades.
Main.java
public class Student{
private String name;
private int grade;
public Student(String name){
this.name = name;
grade = ((int)(Math.random() * 4)) + 9;
}
public String getName(){
return name;
}
public int getGrade(){
return grade;
}
public void setName(String n){
name = n;
}
public void setGrade(int g){
grade = g;
}
public String toString(){
return (name + " is a student in grade " + grade +
".");
}
}
In Java create ArrayList Students from replit The objective of this program is to create a roster of students and then d
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am