Jeremy Bon wrote:. . . I have loades the names in an ArrayList of type String and the quiz marks in an ArrayList of type Double. . . .
That sounds a very bad idea to me. You should create a Student class which encapsulates the name and mark, and put that into your List.
List<Student> studentsList = new ArrayList<>();
The <> was introduced in Java7 and it means to use same type as before.
Don't use a Scanner to read Strings and convert them to
doubles later. Use the Scanner to read the
doubles directly. If you have multiple marks per student, that is a bit more difficult. It is rather awkward, but you can write a constructor like this:-
public Student(String name, double mark1, double mark2,
double mark3, double mark4, double mark5) ...Alternatively you can create an array of marks.
Don't have a method which calculates the average like that; if the Student objcet has the marks, the Student object should have the method to calculate the average.
What do you mean by changing
doubles to
ints? So you want to round with a method like
this one? Or do you simply want a cast, which rounds towards 0? Each is easy enough to do. You can do it in the Student#average method, or have two average methods.