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
Naddik [55]
4 years ago
8

C++

Computers and Technology
1 answer:
kotegsom [21]4 years ago
8 0

Answer:

a) # include <iostream>

# include <conio.h>

# include <stdio.h>

# include <string.h>

using namespace::std;

bool IsPalindrome(const string& str)

{

   if (str.empty())

       return false;

   int i = 0;                // first characters

   int j = str.length() - 1; // last character

   while (i < j)

   {

     

       if (str[i] != str[j])

       {

           return false;

       }

       i++;

       j--;

   }

   return true;

}

int main()

{      

      string str;

      cout<<"Enter the string";

      getline(cin, str);

      bool a= IsPalindrome(str);

      if(a)

      {

          cout<<"Is in palindrome";

      }

      else

      {

          cout<<"Is not in palindrome";

      }

}

b) Modified version of function with full program to discard uppercase or lowercase is as below:

# include <iostream>

# include <conio.h>

# include <stdio.h>

# include <string.h>

using namespace::std;

bool IsPalindrome(const string& str)

{

   if (str.empty())

       return false;

   int i = 0;                // first characters

   int j = str.length() - 1; // last character

   while (i < j)

   {

       char a= tolower(str[i]);

       char b= tolower(str[j]);

       if (a != b)

       {

           return false;

       }

       i++;

       j--;

   }

   return true;

}

int main()

{      

      string str;

      cout<<"Enter the string";

      getline(cin, str);

      bool a= IsPalindrome(str);

      if(a)

      {

          cout<<"Is in palindrome";

      }

      else

      {

          cout<<"Is not in palindrome";

      }

}

Explanation:

Please check the answer section.

You might be interested in
What type of malicious software masquerades as legitimate software to entice the user to run it?
Vlada [557]

Answer:

Trojan horse

Explanation:

A Trojan horse is malicious software that masquerades as a legitimate computer program such as a video game, image file, utility program, or even an antivirus so as to entice the user to run it, thereby allowing an attackers (the developer of the malicious program) to gain access to the data on the computer in an illegal manner.

4 0
3 years ago
Over a TCP connection, suppose host A sends two segments to host B, host B sends an acknowledgement for each segment, the first
Margaret [11]

Answer:

a. Host A will retransmit neither segments

Explanation:

The options are:

a. Host A will retransmit neither segments

b. Host A will retransmit first segment

c. Host A will retransmit the second segment

d. Host A will retransmit both segments

The first acknowledgment is lost but the second acknowledgment arrives before the timer of the first segment expires, and hence the host A gets confirmation that Host B has received both the segments. And hence Host A will retransmit neither segments.

4 0
3 years ago
What is a quick way to determine if a site might contain reliable information? looking at the title of the webpage reading the f
kvasek [131]

The answer is checking the URL.  

Looking at the URL or the web address of the website will help you determine  whether the site contains reliable and credible information or not. Domain names like .edu and .gov are usually trusted sites. What you are looking for are sites with trusted institutions that have a proven record of integrity and reliability. Domain type should always match the content. For example, .edu should have educational material.  By checking the URL, You’ll also be able to establish the person’s name or the agency that published the article.  


8 0
4 years ago
Read 2 more answers
Any game suggestions for nintindo switch.​
alexira [117]

Answer: animal crossing lol

Explanation:

7 0
3 years ago
Identify two real-world examples of problems whose solutions do scale well
stellarik [79]

Explanation:

We should see scaling well as referring to problems that can well be solved using computation. Two real-world examples are:

  • problems involving finding the largest or smallest of several lists of numbers: Usually, a simple program executed to lookup the data set to determine which number fits the properties needed.
  • problems involving equations: By computing the variables (x, y, etc) that make up the equation, and the operations (eg, addition, division) to be performed on the variables the problem can be solved well.
3 0
3 years ago
Other questions:
  • A circuit contains four resistors connected in series. R1 is 100 , R2 is 200 , R3 is 240 , and R4 is 600 . What is the total cir
    13·1 answer
  • How do you view a presentation as your audience would see it?
    14·2 answers
  • This statement lets the value of a variable or expression determine where the program will 1. switch 2. select 3. associative 4.
    11·1 answer
  • Which of the following statements represents a scientific bias?
    15·1 answer
  • In the early days of computer technology, which system was justified because data-processing personnel were in short supply, har
    6·1 answer
  • The final wrap-up after the conflict is resolved is called the __________________________.
    8·1 answer
  • Choose all of the items that represent parts of an operating system.
    6·2 answers
  • Write a paragraph on 'Save Earth Save Life.'​
    12·1 answer
  • Write a program that get
    9·1 answer
  • Your friend Cameron’s little sister is visually impaired. Cameron is worried that his sister will not be able to use technology
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!