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]
3 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]3 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
Exercises
Feliz [49]

Answer:

Rocket

Gas

Explanation:

5 0
2 years ago
Differentiate between isohyetal method and arithmetical average method of rainfall​
prohojiy [21]

Answer:

Explained below

Explanation:

The isohyetal method is one used in estimating Rainfall whereby the mean precipitation across an area is gotten by drawing lines that have equal precipitation. This is done by the use of topographic and other data to yield reliable estimates.

Whereas, the arithmetic method is used to calculate true precipitation by the way of getting the arithmetic mean of all the points or arial measurements that will be considered in the analysis.

7 0
3 years ago
2. A F-22 Raptor has just climbed through an altitude of 9,874 m at 1,567 kph when a disk
BabaBlast [244]

The pressure difference across the sensor housing will be "95 kPa".

According to the question, the values are:

Altitude,

  • 9874

Speed,

  • 1567 kph

Pressure,

  • 122 kPa

The temperature will be:

→ T = 15.04-[0.00649(9874)]

→     = 15.04-64.082

→     = -49.042^{\circ} C

now,

→ P_o = 101.29[\frac{(-49.042+273.1)}{288.08} ]^{(5.256)}

→      = 27.074

hence,

→ The pressure differential will be:

= 122-27

= 95 \ kPa

Thus the above solution is correct.

Learn more about pressure difference here:

brainly.com/question/15732832

3 0
2 years ago
What is the composition, in atom percent, of an alloy that consists of 4.5 wt% Pb and 95.5 wt% Sn?
jeka57 [31]

Answer: Option A is correct -- 2.6 at% Pb and 97.4 at% Sn.

Explanation:

Option A is the only correct option -- 2.6 at% Pb and 97.4 at% Sn. While option B, which is 7.6 at% Pb and 92.4 at% Sn. and option C, which is 97.4 at% Pb and 2.6 at% Sn. and option D, which is 92.4 at% Pb and 7.6 at% Sn. are wrong.

6 0
3 years ago
Question # 3
tino4ka555 [31]

Answer:

I think it's False.

Apologies if I am wrong.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Consider 1.0 kg of austenite containing 1.15 wt% C, cooled to below 727C (1341F). (a) What is the proeutectoid phase? (b) How
    14·1 answer
  • How far do you jog each morning? You prefer to jog in different locations each day and do not have a pedometer to measure your d
    14·1 answer
  • Which of the following is NOT a true statement about construction drawings?
    5·1 answer
  • PLEASE HELP ASAP!!! Thanks
    11·1 answer
  • In 2009 an explosive eruption covered the island of Hunga Ha'apai in black volcanic ash. What type of succession is this?
    7·1 answer
  • Your new team is working hard, but they are all less experienced than you and don't complete their tasks as quickly.What would y
    8·1 answer
  • The Accenture team is involved in helping a client in the transformation journey using Cloud computing. How is myNav beneficial
    6·1 answer
  • The structure of PF3(C6H5)2 is trigonal bipyramidal, with one equatorial and two axial F atoms which interchange positions when
    15·1 answer
  • Nitrogen (N2) enters an insulated compressor operating at steady state at 1 bar, 378C with a mass flow rate of 1000 kg/h and exi
    8·1 answer
  • How does error detection take place
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!