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
Tamika has received an average of 97% on all of her math tests, has done well on her homework assignments, and participates in c
sashaice [31]

Answer:

B is the correct answer.

6 0
3 years ago
Read 2 more answers
What is the imitation of representing numbers with fixed point representation?
Tanzania [10]

Answer:

Hello your question is not complete, The complete question is ; <em>what is the Limitation of representing numbers with fixed point representation</em>

answer:  Limited range of values that can be represented

Explanation:

The limitation of representing numbers with fixed point representation is that there is a Limited range of values that can be represented using this method of representation

Fixed point  representation is a type of representation whereby there is a  fixed number of bits for both integer parts and fractional part.

4 0
2 years ago
How efficient would a 6-bit code be in asynchronous transmission if it had 1 parity bit, 1 start bit, and 2 stop bits?
Lana71 [14]
How efficient well if we are transmitting 6bits and we need 10 to transmit the 6 bits that would be 6/10 = .6 = 60% efficient.
7 0
3 years ago
Please write down your student id. take the last digit of your student id as m.
solmaris [256]
Now why in the world anyone would want to do that....



Really!!!!
7 0
3 years ago
The Internet has made it more difficult for social movements to share their views with the world.
DochEvi [55]
<span>False, the Internet actually paved the way for social movements to share their views to the world easily. It is designed to process and input information within the web trail which can be read through different parts of the world with access to internet. If there could probably be a best form of invention, the internet would be it, because of its capacity to do work at fast rate and to disseminate information to multiple branches at different times.</span>
7 0
3 years ago
Read 2 more answers
Other questions:
  • *****NEED HELP ASAP!!!! COMPUTER HELP!!!! PLEASE!**
    13·1 answer
  • Define a function below called average_strings. The function takes one argument: a list of strings. Complete the function so tha
    11·1 answer
  • Which of the following is not a main function within end user support?
    13·1 answer
  • What is used to configure data sources for applications that require access to a database?
    14·1 answer
  • How can volunteering yo help plan fundraiser for your team or club be a way to develop your strengths?
    13·1 answer
  • Explain the basic method for implementing paging.
    13·1 answer
  • Chemical equations of Carbon + water​
    14·1 answer
  • How exactly do you find the circumference by using C++ Programming? I really need a specific answer.
    14·1 answer
  • Why is it important to identify cables and conductors?​
    9·1 answer
  • After Daniel performed poorly on a test, his teacher advised him to do some self-reflection to figure out how he could get a bet
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!