-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathValidScore.java
More file actions
62 lines (46 loc) · 1.5 KB
/
Copy pathValidScore.java
File metadata and controls
62 lines (46 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import java.util.Scanner;
public class ValidScorce {
public static void main (String[] args){
Scanner input = new Scanner(System.in);
int studentGrade = 0;
int counter = 1;
int wrongCounter = 0;
int counterA = 0;
int counterB = 0;
int counterC = 0;
int counterD = 0;
int counterF = 0;
while(counter <= 10){
System.out.println("you can only enter between 100 -0: ");
studentGrade = input.nextInt();
if(studentGrade < 0 || studentGrade > 100){
System.out.print("error");
wrongCounter = wrongCounter + 1;
}
if (studentGrade >= 0 && studentGrade <= 100){
switch ( studentGrade /10){
case 0, 1, 2, 3, 4: System.out.println ("F, failure just drop out abeggi");
counterF = counterF + 1;
break;
case 5: System.out.println ("D, olodo!");
counterF = counterD + 1;
break;
case 6: System.out.println ("C, average student leleyi naw");
counterF = counterC + 1;
break;
case 7: System.out.println ("B, good student");
counterF = counterB + 1;
break;
case 8,9,10: System.out.println ("A, Genius lomo");
counterF = counterA + 1;
break;
}
}
}
System.out.println (" the total pnumber of students with garde A" + counterA);
System.out.println (" the total pnumber of students with garde B" + counterB);
System.out.println (" the total pnumber of students with garde C" + counterC);
System.out.println (" the total pnumber of students with garde D" + counterD);
System.out.println (" the total pnumber of students with garde F" + counterF);
}
}