New course! Every coder should learn Generative AI!
Try a free lesson0
Please help me to find a error
Can you edit it
4 Answers
+ 3
You missed closing Curly braces at the end
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.length ;j++){
System.out.println(numbers[j]);
}
System.out.println("The average numbers is " + (sum/numbers.length));
}
0
Here's may code
0
Vinze Raymundo
same questions..
https://www.sololearn.com/Discuss/3188087/?ref=app
before posting any question follow certain rules and regulations .
Welcome to Sololearn forum
https://www.sololearn.com/discuss/1316935/?ref=app
https://www.sololearn.com/discuss/3021159/?ref=app