Question: instance, if your program is invoked with 1 and 1 0 , your program will print 2 , 3 , 5 , 7 . You

instance, if your program is invoked with 1 and 10, your program will print 2,3,5,7.
You must:
name your main class "PrimeFinder"
put all your program/classes in a package called "prime".
check for errors in command line arguments and handle it properly.
Example Run of the program
The red color indicates the program's output. The dollar sign ($) indicates your command line prompt and what follows is what the user types on the command line (terminal).
Example 1(positive - no error):
$ java -cp . prime.PrimeFinder 115
2,3,5,7,11,13
Example 2(positive - no error):
$ java -cp . prime.PrimeFinder 77
[7]
Example 3(positive - no error):
$ java -cp . prime.PrimeFinder 2426
[]
Example 4(Negative - bad input):
$ java -cp . prime.PrimeFinder 10050
Error: Max must not be smaller than Min
Example 5(Negative - bad input):
$ java -cp . prime.PrimeFinder 1 abc
Error: Invalid argument(s)
Example 6(Negative - bad input):
$ java -cp . prime.PrimeFinder -1100
Error: Min out of range. Minimum must not be smaller than 0.
Example 7(Negative - bad input):
$ java -cp . prime.PrimeFinder 0100000000
Error: Max out of range. Maximum must not be greater than 1,000,000
Example 8(Negative - bad input):
$ java -cp . prime.PrimeFinder 1.422
Error: Min and Max must be whole numbers.
Example 9(Negative - missing an argument):
$ java -cp . prime.PrimeFinder 10
Usage: PrimeFinder 2,3,5
 instance, if your program is invoked with 1 and 10, your

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!