Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. /**
  2. * Write a description of class CreateQuiz here.
  3. *
  4. * @author (your name)
  5. * @version (a version number or a date)
  6. */
  7. public class Quiz implements Measurable
  8. {
  9. String letterGrade = "";
  10. double score = 0.0;
  11. public double getMeasure()
  12. {
  13. return score;
  14. }
  15.  
  16. public Quiz(double score, String letterGrade)
  17. {
  18. this.score = score;
  19. this.letterGrade = letterGrade;
  20. }
  21. }
  22.  
  23.  
  24. //Tester
  25. import java.util.Arrays;
  26. /**
  27. * Write a description of class BankAndCountryTester here.
  28. *
  29. * @author (your name)
  30. * @version (a version number or a date)
  31. */
  32. public class BankAndCountryTester
  33. {
  34. public static void main(String[] args)
  35. {
  36. Quiz[] quizes = new Quiz[3];
  37. quizes[0] = new Quiz(90,"A");
  38. quizes[1] = new Quiz(80,"B");
  39. quizes[2] = new Quiz(70,"C");
  40.  
  41. Double averageScore = Data.average(quizes);
  42.  
  43. Quiz maxQuiz = (Quiz)Data.max(quizes);
  44.  
  45.  
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement