1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
MakcuM [25]
2 years ago
12

C++A palindrome is a string such as "madam", "radar", "Dad", and "I", that reads the same forwards and backwards. The empty stri

ng is regarded as a palindrome. Wrtie a recursive functionbool isPalindrome(string str, int lower, int upper)that returns true if and only if the part of the string str in positions lower through upper (inclusive at both ends) is a palindrome. Test your function by writting a main function that repeatedly asks the user to enter strings terminated by the ENTER key. These strings are then tested for palindromecity. The program termintaes when the user presses the Enter key without typing any haracters before it.
Engineering
1 answer:
jeka57 [31]2 years ago
5 0

Answer:

See explaination

Explanation:

#include <iostream>

#include<string.h>

using namespace std;

bool isPalindrome(string str, int lower, int upper){

if(str.length() == 0 || lower>=upper){

return true;

}

else{

if(str.at(lower) == str.at(upper)){

return isPalindrome(str,lower+1,upper-1);

}

else{

return false;

}

}

}

int main(){

string input;

cout<<"Enter string: ";

cin>>input;

if(isPalindrome(input,0,input.length()-1)){

cout<<input<<" is a palindrome"<<endl;

}

else{

cout<<input<<" is NOT a palindrome"<<endl;

}

return 0;

}

You might be interested in
Click this link to view O*NET’s Wages and Employment section for Film and Video Editors.
vova2212 [387]

Answer:

much faster than average

Explanation:

did it on edge (2022-2032)

6 0
2 years ago
The level of water in a dam is 6 m. The rectangular gate ABC is pinned at point B so it can rotate freely about this point. When
olchik [2.2K]

Answer:

The reaction at support B

Rb= 235440N

The reaction at support C

RC= 29430N

Explanation : check attachment

6 0
3 years ago
Draw the schematics for the following two battery connections. Can you explain the value of the output voltage in the series con
matrenka [14]

if two 1.5 ya alt batteries are connected to head to the tail the voltage is 3.0 volt it is the because the battery is insidious reduce a voltage equal to number of battery is multiplied by the voltage of individual

5 0
2 years ago
Please define the coefficient of thermal expansion?
Vikki [24]

Answer:

The coefficient of thermal expansion tells us how much a material can expand due to heat.

Explanation:

Thermal expansion occurs when a material is subjected to heat and changes it's shape, area and volume as a result of that heat. How much that material changes is dependent on it's coefficient of thermal expansion.

Different materials have different coefficients of thermal expansion (i.e. It is a material property and differs from one material to the next). It is important to understand how materials behave when heated, especially for engineering applications when a change in dimension might pose a problem or risk (eg. building large structures).

7 0
3 years ago
What is the locating position of the land field?​
Ivahew [28]

Any point on earth can be located by specifying its latitude and longitude, including Washington, DC, which is pictured here. Lines of latitude and longitude form an imaginary global grid system, shown in Fig. 1.17. Any point on the globe can be located exactly by specifying its latitude and longitude.

4 0
2 years ago
Other questions:
  • Given int variables k and total that have already been declared, use a do...while loop to compute the sum of the squares of the
    15·1 answer
  • According to Manor, the example of the subway train in New York City is an example of which type of uniqueness?
    9·1 answer
  • Two players find themselves in a legal battle over a patent. The patent is worth 20 for each player, so the winner would receive
    14·1 answer
  • 6.Identification of Material ParametersThe principal in-plane stresses and associated strains in a plate of material areσ1= 50 k
    5·1 answer
  • What are some of the main causes of accidents?
    7·1 answer
  • Which conditions are required for nuclear fusion to begin
    8·1 answer
  • A block is sliding on a level surface of varying materials, and so its effective coefficient of friction is variable, 0.1t, wher
    6·1 answer
  • WHEN WAS THE FIRST CAR INVENTED?
    13·2 answers
  • Which branch of engineering studies the physical behavior of metallic elements?
    8·2 answers
  • Determine the minimum required wire radius assuming a factor of safety of 3 and a yield strength of 1500 MPa.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!