Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Problem For this problem, you need to write a program to check for palindromic numbers. Palindromic numbers are defined as numbers that are the

image text in transcribedimage text in transcribedimage text in transcribedC++ Problem

For this problem, you need to write a program to check for palindromic numbers. Palindromic numbers are defined as numbers that are the same if read forwards or backwards. For example, 757 is a palindromic number, but 259 is not. You need to print all the even palindromic numbers of a certain number of digits that are also multiples of a given number. 1. Call this program palnums.cpp 2. Modify the function you wrote for the previous program to reverse a number. (5 points) 3. Write a function called printPalin. This function accepts 2 integer parameters - the number of digits and a factor, and returns nothing. The function loops through all numbers with the given number of digits and prints the palindromic numbers that are even and a multiple of the second parameter. (25 points). 4. In the main function, accept the number of digits from the user. If this number is smaller than 1 or greater than 9, print an error message. (5 points) 5. Accept a factor from the user. All numbers printed should be multiples of this number. If the given number if 1 or smaller, print an error message. (5 points). 6. If both inputs are acceptable, call the printPalin function. (5 points) 7. Please include comments wherever appropriate. (5 points) 8. You may only use the iostream library. 4.1 Sample Run 1 Enter the number of digits: 7 Enter the factor: 10 The even 7 digit palindrome numbers that are multiples of 10 are: 4.2 Sample Run 2 Enter the number of digits: 5 Enter the factor: 32 The even 5 digit palindrome numbers that are multiples of 32 are: 21312 23232 25152 25952 27072 27872 29792 40704 42624 44544 46464 48384 61216 63136 63936 65056 65856 67776 69696 80608 82528 84448 86368 88288 4.3 Sample Run 3 Enter the number of digits: 11 The number is not in the expected range (1-9) Enter the factor: -3 The number is not in the expected range (2 or higher)

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

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

u = 5 j , v = 6 i Find the angle between the vectors.

Answered: 1 week ago

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago