Limited access

Upgrade to access all content for this subject

A student takes up to 20 tests during a school year, and we need to keep track of his/her name, email address, age (in years), and numerical test scores (such as 80, 85, 90, 100).

Which of the following would be the best design for the Student class?

A
public class Student {
    private String[] name;
    private String[] email; 
    private int[] age;
    private int[] scores;
    // methods not shown
}
B
public class Student {
    private String name;
    private String email;
    private int age;
    private int[] scores;
    // methods not shown
}
C
public class Student {
    private String name;
    private int email;
    private double age;
    private double[] scores;
    // methods not shown
}
D
public class Student {
    private String name;
    private String email;
    private int age;
    private String[] scores;
    // methods not shown
}
E
public class Student {
    private String name;
    private String email;
    private int age;
    private int scores;
    // methods not shown
}
Select an assignment template