Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions

Question

e. All disagreements among economists are generated by the media.

Answered: 1 week ago

Question

What was the role of the team leader? How was he or she selected?

Answered: 1 week ago

Question

What were the issues and solutions proposed by each team?

Answered: 1 week ago

Question

Were all members comfortable brainstorming in front of each other?

Answered: 1 week ago