forked from cs-dept-ibbul/java2019
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPseudocodeB.java
More file actions
36 lines (35 loc) · 985 Bytes
/
Copy pathPseudocodeB.java
File metadata and controls
36 lines (35 loc) · 985 Bytes
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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
//MATRIC NUMBER:U16/FNS/CSC/2087;
//NAME:Abdullahi idris;
package PseudocodeB;
import java.util.Scanner;
public class PseudocodeB
{
public static void main(String[]arg){
int total = 0;
int counter = 0;
int grade;
float average;
Scanner input = new Scanner(System.in);
System.out.println("Enter the first grade,type 00 to indicate the end");
grade=input.nextInt();
while(grade!=00){
total=total+grade;
counter=counter+1;
System.out.println("Enter the next grade,type 00 to indicate the end");
grade=input.nextInt();
if(grade==0){
break;
}
}
if(counter!=0){
average=total/counter;
System.out.println("The avarage: "+average);
}else
System.out.println("No grades were entered!");
}
}