Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. public static void main(String[] args) {
  2.  
  3. int testscore = 0;
  4.  
  5. int a = 0;
  6. int b =0;
  7. int c = 0;
  8. int d =0;
  9. int f=0;
  10. int count = -1;
  11. double total =0;
  12.  
  13.  
  14.  
  15. while(testscore !=999)
  16. {
  17. if(testscore > 90)
  18. {
  19. System.out.println("A");
  20. a++;
  21. }
  22. if(testscore > 79 && testscore < 90)
  23. {
  24. System.out.println("B");
  25. b++;
  26. }
  27.  
  28. total += testscore;
  29. count++;
  30. System.out.println("Pleace enter a test score");
  31. testscore = scanner.nextInt();
  32.  
  33.  
  34. }//while
  35. total /= count;
  36. System.out.println("Average is :" + total);
  37. System.out.println("Number of A's: "+ a);
  38. System.out.println("Number of B's: "+ c);
  39. System.out.println("Number of C's: "+ d);
  40. System.out.println("Number of D's: "+ d);
  41. System.out.println("Number of F's: "+ f);
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement