Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C++ write recursive programs only and also use the function stated in the problem if possible. WRITING THE DIGITS OF AN INTEGER BACKWARDS Write

IN C++

write recursive programs only and also use the function stated in the problem if possible.

image text in transcribed

WRITING THE DIGITS OF AN INTEGER BACKWARDS Write and implement a C++ function backwards (n) that writes the digits of its positive integer argument in reverse order. For example, if the value of n is 234567, the function writes the digits 7 6 5 4 32. EXPONENTIATION Write and exercise a recursive function exp(x,n) that returns the value of the double x raised to the non-negative integer power n. A run of a program that exercises this function might look like this: Enter a real value: 2.4 Enter an integer: 3 2.4^3 = 13.824 Remember that any non-zero value raised to the power 0 is 1. DETERMINING IF AN INPUT STRING IS A PALINDROME A palindrome is a string in which the letters are the same in both directions, disregarding capitalization and non-letter characters. For example, "Able was I ere I saw Elba." is a palindrome. Write a program that reads a string of characters and calls a recursive function to determine if the letters in the string form a palindrome. Several runs of the program might look like this: csh> pal Enter a line that might be a palindrome. -> Madam I'm Adam. The string Is a palindrome. csh> pal Enter a line that might be a palindrome. -> Go hang a salami, I'm a lasagna hog. The string Is a palindrome. csh> pal Enter a line that might be a palindrome. -> This is another candidate string. The string is NOT a palindrome

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_2

Step: 3

blur-text-image_3

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

Contemporary Issues In Database Design And Information Systems Development

Authors: Keng Siau

1st Edition

1599042894, 978-1599042893

More Books

Students also viewed these Databases questions