Drill3Solutions - *File Grade.java* import...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
****************************File Grade.java*********************************** import java.util.Scanner; public class Grade { public static void main(String args[]) { Scanner input = new Scanner( System.in ); System.out.println("Welcome to the GradeBook program."); // declare variables double score; GradeBreakdown breakdown = new GradeBreakdown(); GradeMax max = new GradeMax(); // read them in and tally up grades do { System.out.print("Please enter a score: "); score = input.nextDouble(); // call on the breakdown to tally score breakdown.tallyGrade(score); // call on max to keep track of top score max.tallyMax(score); } while(score >= 0); // print out the results breakdown.printResults(); max.printResults(); } // end method main } // end class Grade ****************************File GradeMax.java*********************************** public class GradeMax { double highest; boolean validScore; public GradeMax() { highest = 0; validScore = false; } public void tallyMax(double score) { // if this is a valid score
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Drill3Solutions - *File Grade.java* import...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online