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
erma4kov [3.2K]
3 years ago
5

C++ a. Write a program that uses the function isPalindrome given in example 6-6 (Palindrome). Test your program on the followinn

g strings: "madam", "abba", "22", "67876", "444244", and "trymeuemyrt" b. Modify the function isPalindrome of example 6-6 so that when determining weather a string is a palindrome, cases are ignored, that is, uppercase and lowercase letters are considered the same. Example 6-6: 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; return true; }
Computers and Technology
1 answer:
Whitepunk [10]3 years ago
5 0

Answer:

#include <iostream>

#include <array>

using namespace std;

bool isPalindrome(string str)  

{  

int length = str.length();  

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

 if (toupper(str[i]) != toupper(str[length - 1 - i]))

  return false;  

return true;  

}

int main()

{

array<string, 6> tests = { "madam", "abba", "22", "67876", "444244", "trymEuemYRT" };

for (auto test : tests) {

 cout << test << " is " << (isPalindrome(test) ? "" : "NOT ") << "a palindrome.\n";

}

}

Explanation:

The toupper() addition forces characters to uppercase, thereby making the comparison case insensitive.

You might be interested in
This isn't about school but every time it tells me to watch an ad to unlock the answer to a question it prompts a survey and it
Masja [62]
Restart it than see what happens
4 0
3 years ago
Read 2 more answers
Subscribe to (Thicc sickqueen) and like 2 vids and the claim your prize
lara [203]

Answer:

done

Explanation:

5 0
3 years ago
which dual-stack architecture allows ipv4 and ipv6 at the network layer to access a single tcp/udp stack
Archy [21]

The dual-layer-IP allows ipv4 and ipv6 at the network layer to access a single tcp/udp stack.

<h3>What is the dual IP layer?</h3>

The word dual-stack is a word that connote a full or total duplication of all stages in the protocol stack ranging from its applications to the network layer.

Note that the dual-layer-IP method often gives room for a computer to run IPv4 and IPv6 simultaneously  at the network layer, and all of the IP stack can access a different TCP/UDP stack.

Learn more about  architecture  from

brainly.com/question/9760486

6 0
2 years ago
View the attached pic
mr_godi [17]
The answer is the first one
4 0
3 years ago
Read 2 more answers
. Which one of the following is not a JAD participant? 1. Managers 2. System analyst 3. Business development manager 4. Users
asambeis [7]

Answer: 3) Business development manager

Explanation:

 JAD stand for joint application development and it is the methodology which basically involved users and client in the development and designing of the application.

It is the process which basically accelerate the designing of the information technology system. JAD involve managers , system analyst and users to develop the dynamic solution. But it does not involve the business development manager as the JAD basically focused o the individual approach in the development.

6 0
3 years ago
Other questions:
  • How would you say an hard drive works
    9·2 answers
  • How should you dress for a phone interview
    12·2 answers
  • Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 3, print "To
    9·1 answer
  • The function below takes two parameters: a string parameter: CSV_string and an integer index. This string parameter will hold a
    14·1 answer
  • A document format is
    11·2 answers
  • What is the disadvantage of server based network?
    7·2 answers
  • Select the correct answer.
    7·1 answer
  • Write a small program that takes in two numbers from the user. Using an if statement and an else statement, compare them and tel
    12·1 answer
  • A keyboard would be considered _____. Select 2 options.
    13·2 answers
  • What does Stand for in web design
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!