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
nikdorinn [45]
3 years ago
6

Create a recursive method, a method that calls itself, that returns true or false depending on whether or not a given string is

a palindrome. A palindrome is a word that reads the same forwards and backwards, such as "tacocat". Task 2 – The Driver Now we just need to call our method from our Main method and test it with a few different inputs (they may be hardcoded or from user input). Print out the results of each of the method calls along with the string that it was searching through. ∃ Some Sample Output: Received "tacocat" which is indeed a palindrome. Received "lol" which is indeed a palindrome. Received "" which is indeed a palindrome. Received "catermelon" which is not a palindrome.
Computers and Technology
1 answer:
ICE Princess25 [194]3 years ago
6 0

Answer:

public class CheckPalindrome{

public static boolean IsPalindrome(String str){

if(str.Length<1)

{

return true;

}

else

{

if(str[0]!=str[str.length-1])

return false;

else

return IsPalindrome(str.substring(1,str.Length-2));

}

}

public static void main(string args[])

{

//console.write("checking palindromes");

string input;

boolean flag;

input=Console.ReadLine();

flag= IsPalindrome(input);

if(flag)

{

Console.WriteLine("Received"+input+"is indeed palindrome");

}

else

{

Console.WriteLine("received"+input+"is not a palindrome");

}

}

Explanation:

You might be interested in
Print even numbers till 50 in python coding.
e-lub [12.9K]

In python, you can use a simple list comprehension to solve this problem.

print([x for x in range(51) if x % 2 == 0])

This code prints all the even numbers from 0 to 50 including 0 and 50.

4 0
3 years ago
Is Flip book drawings, frame by frame (need great drawing skills).
lyudmila [28]
I would say traditional animation
7 0
3 years ago
How can you stay safe on the Internet? Check all that apply.
Harlamova29_29 [7]

Answer:

all of the above

Explanation:

7 0
3 years ago
Read 2 more answers
Why does brainly keep saying “oops... something went wrong! Try again”
ss7ja [257]
Idek this keeps happening to me too :/
6 0
3 years ago
Read 2 more answers
Which term describes unjust behavior due to a person’s gender or race? A. bias B. discrimination C. persecution D. stereotyping
Nady [450]

Unjust behavior due to someone's race or gender is B

discrimination

4 0
3 years ago
Read 2 more answers
Other questions:
  • Software that people commonly use in the workplace to make their lives easier is called
    15·1 answer
  • The ________ contains the central electronic components of the computer. select one:
    14·1 answer
  • What direction would you travel to go from japan to the united states
    14·1 answer
  • A computerized spreadsheet program is useful for
    6·2 answers
  • When mehtod X calls method Y , method Y called methhod Z, and method Z calles method X, this is called
    9·1 answer
  • __________ are hosted on dedicated computers known as 'web servers'.​
    8·2 answers
  • Disadvatage of using a computer when you don't have knowledge about it​
    14·1 answer
  • Demonstrate the register addressing mode for the following instructions. Also what addressing mode belongs to these instructions
    11·1 answer
  • 2.13.4 Colorful Caterpillarhel ????
    15·1 answer
  • The basic building blocks of java is known as<br><br><br><br>Reply fast! plzzzzzzzzzzz!!!
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!