Question: Write an error-free Java program to do the following things 1. Inputs an integer from the user, N. 2. If the integer is not between

 Write an error-free Java program to do the following things 1.

Write an error-free Java program to do the following things 1. Inputs an integer from the user, N. 2. If the integer is not between 0 and 8,000,000, then the program keeps prompting the user to re-enter the number till the integer is within the proper range. a message stating that it is prime. 4. If the number is not prime, say it is not prime and display its largest factor (other than the number itself There are many ways to do this program, but you must include at least one for loop in your program Sample output (2 different computer runs): Input an integer: 20000000 . Input an integer: 10100 The largest factor of 10100 is 5050 .Input an integer: -3 Input an integer 379 .Your number 379 is prime

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!