import java.util.Scanner; /** * The program is supposed to print out the squares of integers 1 to 20 * inclusive. It then fills an array with square roots of non-negative * integers to 20 inclusive and prints out the array. * @author Sarah Larkin * CS3090, Spring 2018 * Date Last Modified: April 11, 2018 */ public class Debugged { public static void main (String [] args) { // Read in a list of points and store them in an array. // The first number read in will be the count Scanner in = new Scanner(System.in); System.out.println("Please enter how many integers you will input: "); int count = in.nextInt(); int [] array = new int[count]; for (int i = 0; i < count; i++) { System.out.println("Enter an integer: "); array[i] = in.nextInt(); } // print out the array System.out.println("You entered: "); for (int i = 0; i < count; i++) { System.out.print(array[i] + ", "); System.out.println("i: " + i); } // print out the array with each element divided by 2 System.out.println("Here are the numbers, each divided by 2: "); for (int i = 0; i < count; i++) { double j = array[i] / (double) 2; System.out.print(j+ ", "); } } }