Question
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:
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
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