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
Technician A says that daytime running light systems illuminate the taillights to enhance visibility. Technician B says that the
musickatia [10]

I want to say Tech B

I hope this helped :D

4 0
3 years ago
Which of the following is a primary responsibility of the Federal Reserve Bank?
nadya68 [22]
D. Print Money.

pls brainliest.
6 0
3 years ago
Read 2 more answers
Once an audio clip is inserted into a slide you cannot specify options that control playback and appearance
soldier1979 [14.2K]

False

When you insert an audio clip, this can still be viewed. Controlling the playback of the audio clip is done by the interface of the player.Thank you for your question. Please don't hesitate to ask in Brainly your queries. 
8 0
3 years ago
A company purchases a flood insurance policy for its data center. What is its risk
nalin [4]

When a company purchases a flood insurance policy for its data center, the risk management decision it took is: 4) Transference.

Risk management can be defined as a process which involves identifying, evaluating, analyzing and controlling potential risks (threats) that are present in a business, which can serve as an obstacle to its capital, revenues and profits.

Basically, risk management decision typically involves prioritizing cause of action or potential threats, so as to avoid, mitigate or transfer the risk that are likely to arise from such business decisions.

The risks or threats that are faced by a business firm can be transferred to a third-party such as an insurance agency, especially to protect its assets and resources in the event of a natural disaster such as flood, fire, earthquake, etc.

In conclusion, transference is a risk management decision that occurs when  a company purchases a flood insurance policy for its data center.

Read more on risk management here: brainly.com/question/13760012

4 0
2 years ago
Create a generic bubble sort method. Refer to the pseudo code below for a description of the sorting algorithm. Your method must
tangare [24]

Answer:

import java.util.Arrays;

import java.util.Random;

public class GenericSort{

/**

* Method for swapping the value

* @param list

* @param i

* @param j

*/

private static <T> void swap(T[] list, int i, int j) {

if (i != j) {

T temp = list[i];

list[i] = list[j];

list[j] = temp;

}

}

/**

* Generic method for sorting array

* who implement the comparable interface

* @param list

*/

public static <T extends Comparable<T>> void bubble_sort_(T[] list) {

//used the given algo

for (int k=1;k<list.length; k++){

for (int i=0; i<list.length-k;i++){

//using the compareTo method from comparable interface

if(list[i].compareTo(list[k])>0) {

swap(list,k,i);

}

}

}

}

public static void main(String[] args) {

Random rand = new Random();

//Array for int and double

Integer intArray[ ] = new Integer[100];

Double doubleArray []= new Double[100];

for(int i = 0;i<100;i++) {

intArray[i] = rand.nextInt(1000);

doubleArray[i] = 0 + (1000 - 0) * rand.nextDouble();

}

System.out.println("Integer Array Before Sorting ...");

System.out.println(Arrays.toString(intArray));

bubble_sort_(intArray);

System.out.println("Integer Array After sorting.....");

System.out.println(Arrays.toString(intArray));

System.out.println("\n\nDouble array Before Sorting ....");

System.out.println(Arrays.toString(doubleArray));

bubble_sort_(doubleArray);

System.out.println("Double array after sorting ...");

System.out.println(Arrays.toString(doubleArray));

}

}

Explanation:

7 0
3 years ago
Other questions:
  • What is a text feature that could add visual interest and clarity to a procedural document?
    7·2 answers
  • Which of the following types of network can only be accessed by members within a private organization?
    5·1 answer
  • Communications technology and the Internet can be used to reduce the time and costs involved in disseminating financial statemen
    14·1 answer
  • Minerals can form deep inside Earth’s crust by
    13·1 answer
  • What is a computer dedicated to a single function, such as a calculator or computer game? A. TabletB. PDAC.ApplianceD. Minicompu
    6·1 answer
  • If the contents of encrypted file1.nc and encrypted file3.nc are different, but the original file1 and file3 are the same, and y
    12·1 answer
  • Exercise 3.16.4: Happy Face Solita
    10·1 answer
  • L00000000000000000000000000000000000000000000000000000000l they b00ty tickled
    6·2 answers
  • Jason wants to set up his Wi-Fi’s security. He cannot install a central server for authentication. However, he wants to use a pr
    14·1 answer
  • The computer-like model used to describe the way humans encode, store, and retrieve information is the ________ model.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!