BuiltWithNOF
Test Q: LStruc

Write the classes, including constructors, to store the following info:  Teachers have many students. Students can have many test scores. (Not Tested::) ->See if you can describe how to find the average of all test scores, Find all Teachers with a student who has a test score in the 90s.... etc..  Put your answers in WebX and reply to other answers:

class Scores   // class Scores does not use any other classes to be made later.. do first
{
     int score;
     Scores nextScore;  // I used nextScore instead of next so I do not have multiple nexts

     public Scores(int s)
     {
           score = s;
           nextScore = null;
     }

}

class Girls
{
     String name;
     int age;
     Girls nextGirl;

     public Girls(String n, int a)
     {
         name = n;
         age = a;
         nextGirl = null;
     }

}

class Teachers
{
     String name;
     String subject;
     Teachers nextTeacher;
     Teachers prevTeacher;
     Girls firstGirl;

     public Teachers(String n, String s)
     {
           name = n;
           subject = s;
           nextTeacher = null;
           prevTeacher = null;
           firstGirl = null;
     }

}

[Home] [Syllabus] [Sessions]