Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
918 B
5
Indexable
Never
public class ClassroomTester 
{
    public static void main (String[] args)
    {
        Classroom c = new Classroom(2);
        
        Student ada = new Student("Ada", "Lovelace", 12);
        ada.addExamScore(44);
        ada.addExamScore(65);
        ada.addExamScore(77);
        //32

        Student alan = new Student("Alan", "Turing", 11);
        alan.addExamScore(38);
        alan.addExamScore(24);
        alan.addExamScore(31);
        //-7

        // add students to classroom
        c.addStudent(alan);
        c.addStudent(ada);
       
        c.printStudents();
        
        System.out.println("Alan improvement: " + alan.getExamImprovement());
        System.out.println("Ada improvement: " + ada.getExamImprovement());
        
        
        Student mostImproved = c.getMostImprovedStudent();
        System.out.println("The most improved student is " + mostImproved.getName());
    }
}
Leave a Comment