What's wrong in my code there have an error in line 24? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What's wrong in my code there have an error in line 24?

Java

31st Jan 2023, 5:23 AM
Raymundo Vinze
Raymundo Vinze - avatar
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
31st Jan 2023, 5:40 AM
Mozzy
Mozzy - avatar
+ 1
Just add } at end
31st Jan 2023, 6:42 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 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.
31st Jan 2023, 6:48 AM
Mozzy
Mozzy - avatar
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)); }
31st Jan 2023, 5:23 AM
Raymundo Vinze
Raymundo Vinze - avatar
0
Can you edit my code ,please because I'm new learning
31st Jan 2023, 5:44 AM
Raymundo Vinze
Raymundo Vinze - avatar
0
What is the easy way to learn coding
1st Feb 2023, 6:17 PM
Asad Umar cated
Asad Umar cated - avatar