Question: Write a java program that satisfies the following: a) Reading a series of positive integers from the keyboard and store it in Arraylist. The entry

Write a java program that satisfies the following: a) Reading a series of positive integers from the keyboard and store it in Arraylist. The entry stops when 0 or a negative integer is entered. If the user enters something other than a number, the program should print the appropriate message and continue receiving data. b) Output the entered numbers in an ascending order (sorted) as well as discarding any repeated numbers (if the user enters the same number more than once, it must be printed only once). c) Write a simple method that receives a collection of entered numbers and returns the smallest prime number from that collection. If there is no prime number among the numbers, it is necessary to throw an unverified exception NoPrimeNumberException (suppose it is already defined).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!