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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started