Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class StudentTester
- {
- public static void main(String[] args)
- {
- Scanner sc = new Scanner(System.in);
- Student s = new Student("Michael Hincker");
- System.out.println("# of Biology Quizzes: ");
- int bioQuizNumber = sc.nextInt();
- for(int i = 0; i < bioQuizNumber; i++)
- {
- System.out.println("Biology Score: ");
- int bio = sc.nextInt();
- s.addQuiz(bio);
- }
- s.setAverageScore();
- double bioAverage = s.getAverageScore();
- s.setGpaValue(bioAverage, "Biology");
- double bioGpa = s.getGpaValue();
- System.out.println(bioGpa);
- System.out.println("\nBiology Class Score: \n" + bioAverage);
- s.resetScore();
- System.out.println("\n# of Calculus Quizzes: ");
- int calcQuizNumber = sc.nextInt();
- for(int i = 0; i < calcQuizNumber; i++)
- {
- System.out.println("Calculus Score: ");
- int calc = sc.nextInt();
- s.addQuiz(calc);
- }
- s.setAverageScore();
- double calcAverage = s.getAverageScore();
- s.setGpaValue(calcAverage, "calculus");
- double calcGpa = s.getGpaValue();
- System.out.println("\nCalculus Class Score: \n" + calcAverage);
- s.resetScore();
- System.out.println("\n# of Computer Science Quizzes: ");
- int cpQuizNumber = sc.nextInt();
- for(int i = 0; i < cpQuizNumber; i++)
- {
- System.out.println("Computer Science Score: ");
- int cp = sc.nextInt();
- s.addQuiz(cp);
- }
- s.setAverageScore();
- double cpAverage = s.getAverageScore();
- double cpGpa = s.getGpaValue();
- s.setGpaValue(cpAverage, "Comp Sci");
- System.out.println("\nComputer Science Class Score: \n" + cpAverage);
- s.resetScore();
- s.setTotalGpa();
- double gpaTotal = s.getTotalGpa();
- System.out.println(gpaTotal);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement