Question: 2. Create a Java class that calculates the sum of prime numbers between two numbers provided by the user at run time. You must use
2. Create a Java class that calculates the sum of prime numbers between two numbers provided by the user at run time.
You must use nested for loops in your solution
Validate that the lower limit is lesser than the upper limit
Also validate that both lower and upper limits are positive numbers
You must display the sum.
Example:
Enter lower limit: 1
Enter upper limit: 10
Sum of primes: 17
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
