Test Score Scanner

By admin  

test score scanner
java program test results?

I have to write a program that finds the average test score, and the minute scores max. I understand the middle, but you can only find a way to make the minimum and maximum of two numbers, not a set of data. Any suggestions? Import java.util .*; public class (static testAvg Scanner console = new Scanner (System.in); public static void main (String [] args) (double number, count, mean = 0, sum = 0; System.out.println ("How many trials you average?") count = console.nextDouble (); averageDivisor double = count, while (Count> 0) (System.out.println ("Enter degree of proof.") Num = console.nextDouble (), sum = sum + num; count = count – 1) System.out.println ("The average grade of the test is:" + (sum / averageDivisor));))

java.util.Scanner import; GradeReader public class (public static void main (String [] args) (Scanner sc = new Scanner (System.in); int entry, String [] = (ltrGrades "F", "D", "C" "B", "A"); int [] = (gradeRanges 59, 60, 70, 80, 90) minGrade int = 100; maxGrade int = 0; totalScores double = 0; do (System.out.println ("Degree of entry of results, -1 to quit"); string of garbage, while (! Sc.hasNextInt ()) (System.out.println ("entry numbers of only 0 … 100, -1 to quit "); trash = sc.nextLine ();) = entry sc.nextInt () if (input> 0) (for (int i = gradeRanges.length – 1, i> = 0, i -) (if (> = entry gradeRanges [i]) (ltrGrades [i] + = ltrGrades [i]; System.out.println ("You entered:% d, level: '%' n% s ", input, ltrGrades [i]. charAt (0)) break;)) If (Input <gradeRanges [0]) (ltrGrades [0 +] = ltrGrades [0]; System.out.println ("You entered:% d, level: '% n" "input)) + = F totalScores input; minGrade = Math.min (input, minGrade); maxGrade = Math.max (input, maxGrade);)) while (entry! = -1); TotalEntries int = 0; for (int i = ltrGrades.length – 1, i> = 0, i -) (System.out. println ("% 2d – '% s n "% ltrGrades [i]. Length () 1, ltrGrades [i]. CharAt (0)) if (ltrGrades [i]. Length – ()> 1) (+ = totalEntries ltrGrades [i]. Length () -1)) System.out.println ("Total entries: t% 3d% n", totalEntries) System.out.println ("The maximum score was:% t % 3d n ", maxGrade) System.out.println (" The minimum score was:% t % 3d n ", minGrade) System.out.println (" The The average score was:% t % 3.0fn "totalScores / totalEntries);))

Biophotonic Scanner science and stories behind it

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Technorati
  • Twitter
  • Yahoo! Bookmarks

Post a Comment

Your email is never shared. Required fields are marked *

*
*