mirror of
https://github.com/DerTyp7/lf05-java.git
synced 2025-10-29 04:22:12 +01:00
31 lines
824 B
Java
31 lines
824 B
Java
package eingabeUndAusgabe;
|
|
|
|
import java.io.BufferedReader;
|
|
import java.io.IOException;
|
|
import java.io.InputStreamReader;
|
|
|
|
public class Zeugnis {
|
|
public static void main(String[] args) throws IOException {
|
|
int note = 0;
|
|
int count = 0;
|
|
|
|
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
|
|
|
|
System.out.println("Enter your grade (0 - end):");
|
|
|
|
String current_note_input = br.readLine();
|
|
int current_note = Integer.parseInt(current_note_input);
|
|
|
|
while(current_note != 0){
|
|
note += current_note;
|
|
current_note_input = br.readLine();
|
|
current_note = Integer.parseInt(current_note_input);
|
|
count += 1;
|
|
}
|
|
|
|
System.out.println("Durchschnitt");
|
|
System.out.println(note/count);
|
|
|
|
}
|
|
}
|