+ 1
What's wrong in my code there have an error in line 24?
Java
6 Answers
+ 1
Raymundo Vinze
- Missing end braces `}`
- Check spelling of `length`
You're repeating the errors from your previous question. Please go through them again carefully.
https://www.sololearn.com/discuss/3188074/?ref=app
+ 1
Just add } at end
+ 1
Raymundo Vinze
The corrections I have listed are fairly simple. If you can write the code, I'm sure you'll have no problem editing it. Writing and debugging code is all part of the learning process. If I do it for you, then you won't be learning much :)
Try it yourself first and link your code attempt here again if there are issues.
0
import java.util.Scanner;
public class ArraysandArrayLists {
public static void main (String[] args){
//variable and objects declaration
Scanner inp = new Scanner(System.in);
int[] numbers = new int[5];
int i = 0;
int end;
int sum = 0;
do{
System.out.print ("What is your number?" );
numbers[i] = inp.nextInt();
i++;
System.out.print (" Enter 555 to quit and 9 to continue");
end = inp.nextInt();
}
while (end != 555);
//display the output
for (int j = 0; j < numbers.lenght ;j++){
System.out.println(numbers[j]);
}
System.out.println("The average numbers is " + (sum/numbers.lenght));
}
0
Can you edit my code ,please because I'm new learning
0
What is the easy way to learn coding