Advertisement
akosiraff

Student & Moth JAVA

Nov 3rd, 2013
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/student-moth-java/
  3. 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
  4. 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
  5. public Moth(double initialPosition)
  6. and methods
  7. public void moveTolight(double lightPosition)
  8. pulbic double getPosition()
  9. Your MothTester should construct a moth, move it toward a couple of light sources, and check that the moth’s position is as expected.
  10.  
  11. Download: http://solutionzip.com/downloads/student-moth-java/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement