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
True/False
Temka [501]

Answer:

<h2>True </h2>

because it maybe have been broken or can cause minor accident.

8 0
3 years ago
In your new role at Wayne Industries, you have been given the freedom to propose and develop your own project ideas. You have an
gulaghasi [49]

Answer:

461.65 KJ/Kg

Explanation:

In this question, we are asked to calculate the values of heat transferred in the process.

Please check attachment for complete solution and step by step explanation

5 0
4 years ago
How many robots does bailey nursery own ​
givi [52]

Answer:

The Bailey family has flourished during its business’ 110-year history. But Bailey Nurseries’ leaders still operate with the belief that the family doesn’t always know best. The company has grown from a one-man operation selling fruit trees and ornamental shrubs to one of the largest wholesale nurseries in the United States, thanks to insights from those who are family and those who aren’t.

“For a business to thrive, you have to ask for outside help,” says Terri McEnaney, president of the Newport-based company and a fourth-generation family member. “We get an outside perspective through family business programs, advisors and our board, because you can get a bit ingrained in your own way of thinking.”

When Bailey Nurseries chose its current leader in 2000, it brought in a facilitator who gathered insights from key employees, board members and owners. Third-generation leaders (and brothers) Gordie and Rod Bailey picked Rod’s daughter McEnaney, who had experience both inside and outside the company.

Explanation:

5 0
3 years ago
Why does voltage have so many names
BARSIC [14]

Answer:

Europe and most other countries in the world use a voltage which is twice that of the US. ... Originally Europe was 120 V too, just like Japan and the US today, but it was deemed necessary to increase voltage to get more power with fewer losses and less voltage drop from the same copper wire diameter

www.worldstandards.eu › electricity › why-no-standard-voltage

Explanation:

6 0
3 years ago
Read 2 more answers
The electron concentration in silicon at T = 300 K is given by
puteri [66]

Answer:

E=1.44*10^-7-2.6exp(\frac{-x}{18} )v/m

Explanation:

From the question we are told that:

Temperature of silicon T=300k

Electron concentration n(x)=10^{16}\exp (\frac{-x}{18})

                                        \frac{dn}{dx}=(10^{16} *(\frac{-1}{16})\exp\frac{-x}{16})

Electron diffusion coefficient is Dn = 25cm^2/s \approx 2.5*10^{-3}

Electron mobility is \mu n = 960 cm^2/V-s \approx0.096m/V

Electron current density Jn = -40 A/cm^2 \approx -40*10^{4}A/m^2

Generally the equation for the semiconductor is mathematically given by

Jn=qb_n\frac{dn}{dx}+nq \mu E

Therefore

-40*10^{4}=1.6*10^{-19} *(2.5*10^{-3})*(10^{16} *(\frac{-1}{16})\exp\frac{-x}{16})+(10^{16}\exp (\frac{-x}{18}))*1.6*10^{-19}*0.096* E

E=\frac{-2.5*10^-^7 exp(\frac{-x}{18})+40*10^{4}}{1.536*10^-4exp(\frac{-x}{18} )}

E=1.44*10^-7-2.6exp(\frac{-x}{18} )v/m

7 0
3 years ago
Other questions:
  • A 7-cm diameter horizontal pipe connected to the side of a tank at 4 m below the water surface in the tank discharges water to t
    6·1 answer
  • What software do you sue for design and the rapid prototyping machine?
    11·1 answer
  • A 0.5 m^3 container is filled with a mixture of 10% by volume ethanol and 90% by volume water at 25 °C. Find the weight of the l
    13·1 answer
  • A westbound section of freeway currently has three 12-ft wide lanes, a 6-ft right shoulder, and no ramps within 3 miles upstream
    12·1 answer
  • Several different loads are going to be used with the voltage divider from Part A. If the load resistances are 300 kΩkΩ , 200 kΩ
    7·1 answer
  • Precast double-tee units are generally used as structural floors when:________.
    6·1 answer
  • Given a manhole with the outlet invert elevation of 2605. A run of 48 inch pipe connects to the next manhole at an invert elevat
    8·1 answer
  • An artist is creating a gigantic mobile using old cars. On one end of the mobile, a 2100 lb Plymoth is suspended 30 feet from th
    8·2 answers
  • Select three mechanical processes used in the manufacturing phase of engineering.
    11·2 answers
  • PLEASE I NEED HELP!
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!