Answered step by step
Verified Expert Solution
Question
1 Approved Answer
4. Option 2 should ask for an entry of two integers. It should determine and display all prime numbers between the two integers (including the
4. Option 2 should ask for an entry of two integers. It should determine and display all prime numbers between the two integers (including the two integers, if they are prime). Only NetBeans project compressed in .rar or.zip format will be For example, if 3 and 11 are entered, the display should be: 3, 5, 7,11 accepted. All other formats will be graded with 0. Write a Java program with the following specifications 5. The program returns to the main menu after each display from the option and when an invalid input of the option is encountered. 1. The program should display a menu as follows: 6. Validate the option input. Only 1, 2 and 3 are acceptable, otherwise MENU display a message error and return to the main menu. [1] Prime or Composite [2] All Prime Numbers [3] Exit Choose an option? 7. Exit option terminates the program. End of document 2. Option 1 should ask for an integer from the user and displays a corresponding comment as "Prime Number", "Composite Number", oir "Neither Prime nor Composite". 3. Zero and 1 are neither prime nor composite, -1 is prime, while all other negative numbers are composite
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