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
2. There are three drawings that architects and designers use to indicate spaces. What are these drawing?
Zarrin [17]

Answer:

Architectural plans.

Explanation:

An architectural plan is called the drawings made by architects, civil engineers or designers of spaces or interiors, in which these professionals capture their building projects, organizing the distribution of the spaces to be used, the elements to be located in them and, fundamentally, to give construction planning a projection into reality. Thus, the plans help professionals to have a better understanding of the expected end result of the projects they are carrying out.

3 0
3 years ago
How many power station do we have​
loris [4]

Answer: 9,719

Explanation:

5 0
3 years ago
The biggest advantage of sketches is that
steposvetlana [31]

Answer:

They communicate ideas very quickly.

Explanation:

8 0
3 years ago
Write a function named "read_prices" that takes one parameter that is a list of ticker symbols that your company owns in their p
ohaa [14]

Answer:

import pandas pd

def read_prices(tickers):

price_dict = {}

# Read ingthe ticker data for all the tickers

for ticker in tickers:

# Read data for one ticker using pandas.read_csv  

# We assume no column names in csv file

ticker_data = pd.read_csv("./" + ticker + ".csv", names=['date', 'price', 'volume'])

# ticker_data is now a panda data frame

# Creating dictionary

# for the ticker

price_dict[ticker] = {}

for i in range(len(ticker_data)):

# Use pandas.iloc  to access data

date = ticker_data.iloc[i]['date']

price = ticker_data.iloc[i]['price']

price_dict[ticker][date] = price

return price_dict  

7 0
4 years ago
Guys i need help and some ones please help me
Dmitriy789 [7]

Answer:

4. A series of steps engineers use to solve problems.

Explanation:

The process of engineering design is a sequence of procedures that engineers pursue to arrive at a solution to a specific problem. Most times the solution includes creating a product such as a computer code, which fulfills certain conditions or performs a function. If the project in-hand includes designing, constructing, and testing it, then engineers probably adopt the design process. Steps of the process include defining the problem, doing background research,  specifying requirements, brainstorming solutions, etc.

4 0
3 years ago
Other questions:
  • Calculate the availability of a system where the mean time between failures is 900 hours and the mean time to repair is 100 hour
    15·1 answer
  • A power of 100 kW (105 W) is delivered to the other side of a city by a pair of power lines, between which the voltage is 12,000
    9·1 answer
  • A polymeric extruder is turned on and immediately begins producing a product at a rate of 10 kg/min. An operator realizes 20 min
    12·1 answer
  • Often an attacker crafts e-mail attacks containing malware designed to take advantage of the curiosity or even greed of the reci
    14·1 answer
  • WHAT IS MEANT BY BJT AND FUNCTION OF BJT
    8·1 answer
  • Select the correct text in the passage.
    6·2 answers
  • Which of these credit building options do you personally think is the easiest method that you can see yourself doing? Explain yo
    8·1 answer
  • Scientists use characteristics to compare stars. Match each characteristic on the left with the statement on the right that uses
    15·1 answer
  • In the figure show, what's the distance from point H to point C?
    14·1 answer
  • What is the importance of the causal link<br> in work accidents?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!