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]
3 years ago
8

C++

Computers and Technology
1 answer:
kotegsom [21]3 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
In the program below, which two variables have the same scope?
bagirrra123 [75]

Answer:

rhymeWord

Explanation:

correct answer edge 2020

3 0
3 years ago
Read 2 more answers
Select the correct answer from each drop-down menu.
mihalych1998 [28]

Answer:

i dont know

Explanation:

they block every thing for smoe reason

3 0
3 years ago
Directions: Using the decoder key and the code chart on the second page, find out the name that has been coded. After coding the
Karo-lina-s [1.5K]

What is the decodder key???

7 0
4 years ago
The term that refers to the standard computer language for creating web pages is called:
Pavel [41]

Answer:

Language programming Web's programming language

Explanation:

6 0
4 years ago
What else needs to be done when creating a site?
SSSSS [86.1K]
When you are creating a website, you will usually need to add details to the website. If you're coding a website as HTML, you always have to make sure your code is correct. If one thing is a mess up, you have to start the whole thing all over again. 
5 0
3 years ago
Other questions:
  • Dani wants to create a web page to document her travel adventures. Which coding language should she use? HTML Java Python Text
    15·1 answer
  • When a structure satisfies all the properties of a relation except for the first item—in other words, some entries contain repea
    7·1 answer
  • If a given router can connect to at most k networks, how many routers, r, are required to connect n networks? write an equation
    7·1 answer
  • A technology company only hires applicants who are under the age of 30. This company could face possibly _________ consequences
    9·2 answers
  • A beginning driver may tend to oversteer. This means the driver what? Btw Cars are technology so that is why it is under Compute
    11·1 answer
  • Hey guys!
    5·2 answers
  • Select the correct answer from each drop-down menu.
    8·2 answers
  • Jose has 3/5 kilogram of peppermints and 2/3 kilogram of candy canes. How many kilograms of candy does he have?
    10·1 answer
  • ____ is Windows XP system service dispatch stubs to executables functions and internal support functions.
    13·1 answer
  • Who invented Satellites? What purpose does it serve? How has it impacted society today?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!