Question: JAVA HW Write a menu-driven program which should loop the menu continuously until the user chooses to exit the program. The menu should have the

JAVA HW

Write a menu-driven program which should loop the menu continuously until the user chooses to exit the program. The menu should have the following options: 1. Display Prime Palindromes 2. Display Mirrored Primes 3. Exit Program

Option 1 Prime Palindromes: A prime palindrome is a prime number that is also a palindrome. Example: 131 is a prime number and also a palindrome. When the user chooses Option 1, you should ask them how many prime palindromes to display (n), then display the first n prime palindromes, with 10 numbers per line separated by a single space.

Option 1 Sample:

How many prime palindromes to display?: 20 2 3 5 7 11 101 131 151 181 191 313 353 373 383 727 757 787 797 919 929 

Option 2 Mirrored Primes: A mirrored prime is a non-palindrome prime whose reverse is also prime. Example, 17 and 71 are primes and mirrors of each other. When the user chooses Option 2, you should ask them how many mirrored primes to display (n), then display the first n mirrored primes, with 10 numbers per line separated by a single space.

Option 2 Sample:

How many mirrored primes to display?: 20 13 17 31 37 71 73 79 97 107 113 149 157 167 179 199 311 337 347 359 389 

Input Validation:

No input validation required.

Requirements:

To get credit for this assignment you must use a minimum of 5 different methods other than main. In reality you will more than likely need more, but 5 is the minimum.

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!