java programs out of the Big Java 4th edition

mulung
 (Not rated)
 (Not rated)
Chat

P3.8 Implement a class Student. For the purpose of this exercise, a student has a name and total quiz score. Supply an appropriate constructor and method getName(), addQuiz(int score), getTotalScore(), and getAverageScore(). To compute the lattter, you also ned to store the number of quizessthat the student took. Supply a StudentTester class that test all methods

P3.12 Implement a class Moth that models a moth flying across a straight line. The moth has a position, distance from a fixed origin. When the moth moves toward a point of light, its new position is halfway between its old posistion and the position of the light source. Supply a constructor
public Moth(double initialPosition)
and methods
public void moveTolight(double lightPosition)
pulbic double getPosition()
Your MothTester should construct a moth, move it toward a couple of light sources, and check that the moth's position is as expected.

    • 13 years ago
    BEST SOLUTION ANSWER
    NOT RATED

    Purchase the answer to view it

    • 2013-11-01_135034_java_asig.docx
    • 2013-11-01_134520_javaaisg.zip