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
Who wrote the book of luke​
netineya [11]
Luke himself wrote t the book
5 0
2 years ago
7. One hazard associated with driving downhill is:
melamori03 [73]

Answer:

is this a multipe choice question? or should i answer what i would think is dangerous about driving down hill?

Explanation:

please elaborate so i can answer better! :D

4 0
3 years ago
Analyze and write a comparison of C's malloc and free functions with C++'s new and delete operators. Use safety as the primary c
Alisiya [41]

Answer:

The C's malloc and free functions and the C++'s new and delete operators execute similar operations but in different ways and return results.

Explanation:

- The new and delete operators return a fully typed pointer while the malloc and free functions return a void pointer.

-The new and delete operators do not return a null value on failure but the malloc/free functions do.

- The new/delete operator memory is allocated from free store while the malloc/free functions allocate from heap.

- The new/delete operators can add a new memory allocator to help with low memory but the malloc/free functions can't.

- The compiler calculates the size of the new/delete operator array while the malloc/free functions manually calculate array size as specified.

5 0
3 years ago
It is a function that removes an existing file from the server.
kondaur [170]

Answer: A) remove()

Explanation:

 The remove() function removes an existing file from the server but it does not affect the existing directory and file. We can also ease and remove files in the file handling by using the remove() function. And it is built-in function that removes any type of the data from the function by taking values in the parameter whose values are equal with the passing value in the parameter.

7 0
3 years ago
Anti-bullying laws in most states are designed to provide
Vera_Pavlovna [14]

Answer:

to protect children enrolled in kindergarten, elementary, and secondary schools and learning centers ( from being bullied. It requires Schools to adopt policies to address the existence of bullying in their respective institutions.

Explanation:Hope this helps pls mark brainliest!

6 0
3 years ago
Other questions:
  • The following memo does not follow the correct format. What should be changed? To: Stacy, Allen, and Emma Date: August 12, 2012
    10·2 answers
  • What Is the output of the following: =OR (5 &lt;7, 16*Rand ()&gt;23,FALSE)
    5·1 answer
  • "what are the problems with tcp over wireless network?"
    15·1 answer
  • To create a cover letter to send to potential employers along with a resume, what software program should you use ?
    6·2 answers
  • Which types of operating systems execute program independent of the users and generate output within a specific amount of time?
    5·1 answer
  • Which of the following best describes a feedback loop?
    11·1 answer
  • Picking up sound over a great distance while making it seem to come from close up.
    11·1 answer
  • Type which type of interference we will install after installing operating system​
    11·1 answer
  • Which of these standards has the fastest connection?
    12·1 answer
  • I still need help, thank you! Will give Brainliest ​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!