Question: Here is the sceleton code: public class PA4c { /** * Removes all duplicate values * from the supplied list * * @param list list

Here is the sceleton code:
public class PA4c {
/**
* Removes all duplicate values
* from the supplied list
*
* @param list list from which to remove repeated elements
*/
public static void removeRepeated(ArrayList
// replace with your code
}
/**
* Reads numbers from the keyboard and
* outputs the list of distinct values
*
* @param args command-line arguments, ignored
*/
public static void main(String[] args) {
// replace with your code
}
}
Your task is to write a program that reads any number of integers from the console (via a Scanner), stores them in an ArrayList, removes duplicates from the list, and then outputs the remaining distinct values First, implement the removeRepeated method, which removes duplicates from a supplied list note that you are not allowed to use advanced data structures (e.g. sets) to do this for you. Then implement the main method, which reads as many integers as the user desires into an ArrayList, adds them to an ArrayList, uses the removeRepeated method, and then outputs the distinct values. When you are testing your code in Eclipse, and are done typing integers, press enter (i.e. to proceed to a new line) and then press CTRL+D (Mac) or CTRL+Z (Windows) to indicate to Eclipse that you are done typing (this is code for EOF, or end-of-file; sometimes you may need to change focus to the code window and then back to the console for Eclipse to properly register the EOF) Below are example runs of a completed program... Enter integers: No values entered. Enter integers: 1 23 2 1 The distinct integer(s): 1 2 3 Enter integers: 111 2 1221 23 2 1 23 1 The distinct integer(s): 1 2 3 Enter integers: 88 8 88 8866668888 6667 777766688877758 8 7 66 6 6 7 5 5 3 3 876 5 0009 309 8 675 The distinct integer(s): 8 6 7 5 3 9
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
