/* This program will input a list of numbers from the user and then using some methods locate and remove all duplicates */ import java.util.Scanner; public class Prog7_15 { public static void main(String[] args) { int[] array = new int[100]; // assume no more than 100 elements Scanner in = new Scanner(System.in); // get the elements, this method returns the number of elements int number = getValues(in, array); System.out.print("Array before eliminating duplicates: "); output(array, number); // output the list before removing duplicates number = removeDuplicates(array, number); // remove the duplicates, this method returns the new size of the array System.out.print("\n\nArray after eliminating duplicates: "); output(array, number); // output the list after removing duplicates } // this method input a list of values from the user entering each into an array and returns the number of elements input into the array public static int getValues(Scanner in, int[] a) { int number = 0; System.out.print("Enter a list of values, -999 to exit, no more than 100 total elements "); int temp = in.nextInt(); while(temp!=-999&&number<100) { a[number++]=temp; System.out.print("Enter next value, -999 to exit, no more than 100 total elements "); temp = in.nextInt(); } return number; } // this method outputs all elements of the array on one line public static void output(int[] a, int number) { for(int i=0;i