Created
December 5, 2016 22:32
-
-
Save NenadSpasic/a8a950c35f9905bc1088e3f4ba68c48e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Created by Nenad Spasic on 12/5/2016. | |
| */ | |
| import java.util.Scanner;//import java.util.Scanner; | |
| public class Counter { | |
| public static void main ( String[]args ) { | |
| Scanner input = new Scanner(System.in); | |
| int counter = 0; | |
| int total = 0; | |
| int average; | |
| int grade; | |
| while (counter <= 5) { | |
| grade = input.nextInt(); | |
| total = total + grade; | |
| counter++; | |
| } | |
| average = total/5; | |
| System.out.println("your average is " + average); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment