Advertisement
Guest User

StudentTester

a guest
Oct 1st, 2014
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class StudentTester
  3. {
  4. public static void main(String[] args)
  5. {
  6. Scanner sc = new Scanner(System.in);
  7. Student s = new Student("Michael Hincker");
  8. System.out.println("# of Biology Quizzes: ");
  9. int bioQuizNumber = sc.nextInt();
  10. for(int i = 0; i < bioQuizNumber; i++)
  11. {
  12. System.out.println("Biology Score: ");
  13. int bio = sc.nextInt();
  14. s.addQuiz(bio);
  15. }
  16. s.setAverageScore();
  17. double bioAverage = s.getAverageScore();
  18. s.setGpaValue(bioAverage, "Biology");
  19. double bioGpa = s.getGpaValue();
  20. System.out.println(bioGpa);
  21. System.out.println("\nBiology Class Score: \n" + bioAverage);
  22. s.resetScore();
  23. System.out.println("\n# of Calculus Quizzes: ");
  24. int calcQuizNumber = sc.nextInt();
  25. for(int i = 0; i < calcQuizNumber; i++)
  26. {
  27. System.out.println("Calculus Score: ");
  28. int calc = sc.nextInt();
  29. s.addQuiz(calc);
  30. }
  31. s.setAverageScore();
  32. double calcAverage = s.getAverageScore();
  33. s.setGpaValue(calcAverage, "calculus");
  34. double calcGpa = s.getGpaValue();
  35. System.out.println("\nCalculus Class Score: \n" + calcAverage);
  36. s.resetScore();
  37. System.out.println("\n# of Computer Science Quizzes: ");
  38. int cpQuizNumber = sc.nextInt();
  39. for(int i = 0; i < cpQuizNumber; i++)
  40. {
  41. System.out.println("Computer Science Score: ");
  42. int cp = sc.nextInt();
  43. s.addQuiz(cp);
  44. }
  45. s.setAverageScore();
  46. double cpAverage = s.getAverageScore();
  47. double cpGpa = s.getGpaValue();
  48. s.setGpaValue(cpAverage, "Comp Sci");
  49. System.out.println("\nComputer Science Class Score: \n" + cpAverage);
  50. s.resetScore();
  51.  
  52. s.setTotalGpa();
  53. double gpaTotal = s.getTotalGpa();
  54. System.out.println(gpaTotal);
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement