3주차 JAVA숙제가 나왔습니다^^

내용은

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 받자고요

“3주차 JAVA숙제가 나왔습니다^^”의 2개의 댓글

  1. 靑綠藍 2009-03-25 23:59응답

    내일도 6시간 연속 자바의 세계라는 직감이 꽃히는데 이거?

    1. 윤여천2009-03-26 00:02응답

      열심히 하면 할수 있을꺼야,,
      내용은 길어도 할거는 별로 없으니까,,,

댓글 남기기