Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- int testscore = 0;
- int a = 0;
- int b =0;
- int c = 0;
- int d =0;
- int f=0;
- int count = -1;
- double total =0;
- while(testscore !=999)
- {
- if(testscore > 90)
- {
- System.out.println("A");
- a++;
- }
- if(testscore > 79 && testscore < 90)
- {
- System.out.println("B");
- b++;
- }
- total += testscore;
- count++;
- System.out.println("Pleace enter a test score");
- testscore = scanner.nextInt();
- }//while
- total /= count;
- System.out.println("Average is :" + total);
- System.out.println("Number of A's: "+ a);
- System.out.println("Number of B's: "+ c);
- System.out.println("Number of C's: "+ d);
- System.out.println("Number of D's: "+ d);
- System.out.println("Number of F's: "+ f);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement