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
What kind of energy transformation occurs when you call someone on a cell phone?
andrew11 [14]

The <em><u>sound energy into electric energy and then into radiant energy.</u></em>

<em>[That's it]:)</em>

5 0
2 years ago
Given an array a, write an expression that refers to the first element of the array .
steposvetlana [31]
A[ 0 ]

-------------------------------------------
4 0
3 years ago
If you want to tune into a radio station that is carried by a signal with wavelength 3.0 meters, what channel would you choose?
Over [174]

Answer:  The radio should be tuned to 100. 0 Mhz.

Explanation:

As radio waves are electromagnetic waves, like x-rays, UV rays, and all the wavelengths of visible light, they propagate in the free space at the speed of light: 3. 10⁸ m/s.

At any wave, there is a fixed relationship between the distance travelled by the wave along one cycle (which is called wavelength ) and the speed at which the wave oscillates (which is called the frequency of the wave), with the speed at which the wave propagates, as follows:

λ (wavelength) =  v (speed) / f (frequency)

Replacing by the values, and solving for frequency, we have:

f = 3. 10⁸ m/seg / 3 m = 10⁸ 1/sec = 10⁸ Hz = 100. 0 Mhz

This is the radio channel to which must be tuned in order to listen the station with a wavelength of 3 m, in the FM band.

6 0
3 years ago
Which fact does lean green eco machines present to show that electric cars are not perfect
Yuri [45]

Answer: HOPE THIS HELPED YOU! :D ;)

Eco cars are still too expensive for most car buyers

Explanation:

5 0
3 years ago
Read 2 more answers
Three healthcare firms jointly own and share the same cloud resources to meet their computing needs. Which cloud model does this
Stels [109]

Answer:

yes

Explanation:

yall share the same thing

5 0
2 years ago
Other questions:
  • A user is claiming a host can be reached via the IP address but not through the name. What should a technician do first to resol
    13·1 answer
  • Below is a 4-bit down-counter. What is the largest number of the counter if the initial state Q3Q2Q1Q0=0011? (D3 and Q3 are MSB,
    14·1 answer
  • Which party controlled the White House and politics in the late 1800s, except for Grover
    6·2 answers
  • Within a major students can choose to study a specific area within major. For example a journalism student may study military jo
    8·1 answer
  • The Internet began when a large company wanted to sell products online. <br> True or flase?
    6·2 answers
  • What do Business Analysis workers do? Check all that apply.
    15·2 answers
  • What constructs break or bend the normal Syntax patterns of scheme?
    15·1 answer
  • Why do we need operating systems?
    7·1 answer
  • So I tried asking for help with my code on stackoverflow but the people there were very condescending and mean plus my questions
    7·1 answer
  • Cable inside the computer transferring data between the mother board and storage devices.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!