Hello guys. I'm trying to create a simple school system
It's a system that will receive only students and tests.
Students may have names and a kind of a list with test notes.
My system have to show the following options to the user:
- Register student
- List students
- See biggest note.
E. Exit
If I choose the 2st option, the output will be something like this :
- Carl
- Jean
- Peter
B. Back
E. Exit
If I choose 2 ( Jean ), I will have this :
Student : Jean
Tests Mean : 0
Biggest note : 0
Lower note : 0
Done tests : 0
- Register test for this student
B. Back
E. Exit
If I choose 1 In order to register test, I have to ask the user the test note and register it .
I have done some things already but I'm facing some troubles :
-> My student class:
import java.util.ArrayList;
public class Student {
private String name; // 1o nome do aluno
private ArrayList<Tests> tests; //ArrayList de provas
public Student(String name){
this.name=name;
tests = new ArrayList<Tests>();
}
public String getName() {
return name;
}
public int testsNumber(){
return tests.size();
}
public int testsMean(ArrayList tests){
int sum=0;
for(int d : tests){
sum+= d;
}
}
}
And I want to create a System class, where the user will can do the options that I showed in the beginning.
But idk how to store the grades in the Student class. I created a ArrayList of Tests but how can I register those tests ? I need help with :
-> Adding a grade into my tests ArrayList
-> Returning the mean of my tests ArrayList
-> Return biggest and lowest grades
(This 3 topics inside Student class. Or not. Idk)
And, in system class :
-> Create a new Student
-> Show the options that I send in the top
-> Make the options work
Can someone help me ? I think it's simple but idk how to proceed. I will send the Test class inside help chat.