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
7. Malware could A. cause a system to display annoying pop-up messages B. be utilized for identity theft by gathering personal i
beks73 [17]

Answer:

D

Explanation:

Malware can be used for many things, a click of a button can send complete access to the attacking system. Malware comes in all formes and powers.

4 0
2 years ago
The term used to describe whereby old and new media are available via the integration of personal computers and high speed satel
garri49 [273]

The term used to describe whereby old and new media are available via the integration of personal computers and high speed satellite based phone or cable links is: media convergence.

<h3>What's a good illustration of media convergence? </h3>
  • Smartphones, laptops, and ipads are the finest instances of media convergence since they combine several forms of digital media, including radio, cameras, TVs, music, and more, into a single, straightforward gadget.
  • The blending of formerly separate media platforms and technologies through digitization and computer networking is referred to as media convergence. Another name for this is technical convergence.
  • Media ownership concentration, sometimes referred to as media consolidation or media convergence, is the process through which a smaller number of people or organisations come to control a larger portion of the mainstream media.
  • According to recent study, there is a rising amount of consolidation in the media sectors, which are already highly concentrated and controlled by a very limited number of companies.

To learn more about media convergence, refer to the following link:

brainly.com/question/25784756

#SPJ4

6 0
1 year ago
Pleas help I will give brainiest
stellarik [79]
1) A
2)D
3)C
4)A
5)D
Hope this will help u
5 0
3 years ago
Read 2 more answers
4. When the keyword ____________________ is followed by a parenthesis, it indicates a call to the superclass constructor.
Andreyy89

Answer:

Super

Explanation:

In object-oriented programming (OOP) language, an object class represents the superclass of every other classes when using a programming language such as Java. The superclass is more or less like a general class in an inheritance hierarchy. Thus, a subclass can inherit the variables or methods of the superclass.

Basically, all instance variables that have been used or declared in any superclass would be present in its subclass object.

Hence, when the keyword super is followed by a parenthesis, it indicates a call to the superclass constructor and it should be the first statement declared in the subclass constructor.

5 0
2 years ago
The recommended flux for electrical soldering is A. antimony. B. sal ammoniac. C. rosin. D. muriatic acid.
expeople1 [14]
I pretty sure its D muriatic acid
3 0
3 years ago
Other questions:
  • Which one of the following statements is correct? a. Web browsers cannot function without cookies. b. Cookies are text files and
    9·1 answer
  • Turning up the transmit power or utilizing a high gain antenna to reach wireless users from a distance increases your exposure t
    12·1 answer
  • In the Mouse Properties window, you can?
    8·1 answer
  • Refer to the exhibit. A network security analyst is using the Follow TCP Stream feature in Wireshark to rebuild the TCP transact
    8·1 answer
  • HOW TO FREE UP RAM/MEMORY ON YOUR DEVICE?
    12·2 answers
  • he superclass Student contains: a constructor that accepts a String corresponding to the name of the school the student attends
    15·1 answer
  • B) The company's chief financial officer recognizes the need for an upgrade to the smart watches, but does not understand why th
    8·1 answer
  • What is the correct sequence in which a computer operates​
    6·1 answer
  • Assume the user types in 7 for x and 2 for y. What is output by the
    6·1 answer
  • Identify and explain 4 traditional (old ways) marketing approaches used by University uses in reaching
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!