-3

This is the part of my program where I want to ask the user to input the serial code of the book then display it in an array.

Scanner scan = new Scanner(System.in);

System.out.println("input the size of the array");
int size = scan.nextInt();

float books[]= new float[size];
System.out.println("input the codes of the book ");
for (int i=0; i<=size; i++){
    books[i]= scan.nextFloat();
}
System.out.println(Arrays.toString(books));
Federico klez Culloca
  • 22,898
  • 15
  • 55
  • 90
tendou
  • 1

0 Answers0