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
SCORPION-xisa [38]
3 years ago
9

Write a program that uses the function isPalindrome given in Example 6-6 (Palindrome). Test your program on the following string

s:
madam, abba, 22, 67876, 444244, trymeuemyrt

Modify the function isPalindrome of Example 6-6 so that when determining whether a string is a palindrome, cases are ignored, that is, uppercase and lowercase letters are considered the same.

The isPalindrome function from Example 6-6 has been included below for your convenience.

bool isPalindrome(string str)
{
int length = str.length();
for (int i = 0; i < length / 2; i++) {
if (str[i] != str[length – 1 – i]) {
return false;
} // if
} // for loop
return true;
}// isPalindrome

Your program should print a message indicating if a string is a palindrome:

madam is a palindrome
Computers and Technology
1 answer:
WITCHER [35]3 years ago
3 0

Answer:

Explanation:

bool isPalindrome(string str)

{

   int length = str.length();

   for (int i = 0; i < length / 2; i++) {

      if (str [i] != str [length – 1 – i]) {

         return false;

         }

    }

cout << str << "is a palindrome";

return true;

}

You might be interested in
Give at least five (5) practices that you must observe in your classroom.​
atroni [7]

Answer:

Offer second chances/clean slates.

Be resourceful.

Make learning active.

Be an advocate.

Pursue lifelong learning.

8 0
3 years ago
Read 2 more answers
You need a version of usb technology that will support older usb devices, of which you have many, as well as newer ones. what wo
andrezito [222]
I would want to see the word compatible in the specs
8 0
3 years ago
Sets of rules that a computer uses to solve problems?
jonny [76]

Protocal

I need to make this 20 charaters so ye

8 0
3 years ago
Read 2 more answers
What does spyware do on your computer?
Morgarella [4.7K]
It's a malware, and it basically let's the person/hacker/culprit get information off your computer without the owner of the computer knowing that the person is doing it. It's often used to find keystrokes, passwords, online interaction, and other personal data.
5 0
3 years ago
write a python function that takes string j and returns a dictionary showing number of letters and digits in j. The returned dic
k0ka [10]

Explanation:

def letterDigitCount(j):

dic={"digits":0,"letters":0}

for a in j:

if a.isdigit():

dic["digits"]+=1

elif a.isalpha():

dic["letters"]+=1

return dic

3 0
3 years ago
Other questions:
  • An electronic braille embosser that translates text from a braille keyboard to a printer:
    10·1 answer
  • When subjects are given two drinks but not told what they are drinking in order to get accurate results on which is the better t
    6·1 answer
  • What would be a good hash code for a vehicle identification that is a string of numbers and letters of the form “9x9xx99x9xx9999
    9·1 answer
  • Pls help me
    5·1 answer
  • A user calls you and says that when they try to connect to the internal website, they are prompted for authentication. The user
    14·1 answer
  • Select the correct answer.
    6·2 answers
  • Allows a user to control the<br>volume of the computer​
    8·1 answer
  • Johnathan was assigned to complete a project with three other people. What benefit will he get from working with the team?
    15·1 answer
  • Que es un vlog? Cual es la diferencia entre vloc y papgina web? ​
    7·1 answer
  • How to improve a poor game design puzzles
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!