In Java create ArrayList Students from replit The objective of this program is to create a roster of students and then d

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

In Java create ArrayList Students from replit The objective of this program is to create a roster of students and then d

Post by answerhappygod »

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 +
".");
}
}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply