Java newb needs help
Go to solution
Solved by Xenift,
Create a loop which allows the user to enter multiple times till they want it to stop.
If it is exactly 10 grades to be entered, use a while loop.
int i = 1;
int total = 0;
while(i<10){
System.out.print("Enter grade: ");
total = sc.nextInt() + total;
}
Yadda yadda something like this.
sc in this case is the object, declare the object first like this...Scanner sc = new Scanner(System.in)
If it is more than lets say.....infinity.
use a do while loop

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now