내용은
Implement a class Student. For the purpose of this exercise, a student has a name and a total quiz score. Supply an appropriate constructor and methods getName(), addQuiz(int score), getTotalScore(), and getAverageScore(). To compute the latter, you also need to store the number of quizzes that the student took. Supply a StudentTester class that tests all methods.

Use the following class as your tester class:
/**
   This program tests the Student class.
*/
public class StudentTester
{
   public static void main(String[] args)
   {
      Student student = new Student("Cracker, Carla");

      // TODO: Add some quizzes

      // TODO: Print actual and expected name, total score
  }
}
Complete the following class in your solution:
/**
   A student who is taking quizzes.
*/
public class Student
{ 
   /**
      Constructs a student with a given name.
      @param n the name
   */
   public Student(String n)
   {  
      . . .
   }

   /**
      Gets the name of this student.
      @return the name
   */
   public String getName()
   {  
      . . .
   }

   /**
      Adds a quiz score.
      @param score the score to add
   */
   public void addQuiz(int score)
   {  
      . . .
   }

   /**
      Gets the sum of all quiz scores.
      @return the total score
   */
   public double getTotalScore()
   {  
      . . .
   }
   
   /**
       Gets the average of all quiz scores.
       @return the average score
   */
   public double getAverageScore()
   {  
      . . .
   }
   . . .
}
 
이렇게 길지만 1문제라는거^^ 처음부분만 잘읽으면 할수 있을거에요,,
그리고 자바강좌가 안올라오는건 저도 자바를 잘 몰라서 공부중이거든요 ^^a
어쨌든 열심히 해서 낙오자 없이 모두 S 받자고요

'대학생활 > JAVA' 카테고리의 다른 글

내맘대로 강좌 JAVA편 4  (0) 2009.03.25
내맘대로 강좌 JAVA편 3  (0) 2009.03.25
내맘대로 강좌 JAVA편 2  (0) 2009.03.16
내맘대로 강좌 JAVA편 1  (3) 2009.03.16
2주차 JAVA숙제,,,(파일 삭제)  (0) 2009.03.15