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
Please try and solve this
Genrish500 [490]

Answer:

Many students coming into Woodworking 108 are bewildered by “all those little marks ... Parts of an inch will be referred to in fraction form instead of its decimal equivalent. ... on divisions of 2: 1” 2= ½”. ½” 2= ¼”. ¼” 2= 1/8”. 1/8” 2= 1/16”. 1/16” 2= 1/32” ... way is to realize there are 16/16 in an inch and count back 3 of the 1/16 ...

Explanation:

4 0
3 years ago
Which of the following is the best subject line for an e-mail sent to co-workers about rescheduling a team meeting?
Ilya [14]
Reschedule the team meeting <span />
6 0
2 years ago
Information that has been analyzed and refined so that it is useful to policymakers in making decisions; specifically, decisions
denis-greek [22]

Answer:

Intelligence

Explanation:

Intelligence is the product resulting from the collection, collation, evaluation, analysis, integration, and interpretation of collected information. It is a specialised information product that provides an adversary with information required to further its national interests. One of the most important functions of intelligence is the reduction of the ambiguity inherent in the observation of external activities.rations.  

In most cases, the development of an intelligence product involves collecting information from a number of different sources. In some cases, information may be disseminated immediately upon collection based upon operational necessity and potential impact on current operations.

Strategic intelligence provides policy makers with the information needed to make national policy or decisions of long-lasting importance. Strategic intelligence collection often requires integrating information concerning politics, military affairs, economics, societal interactions, and technological developments. It typically evolves over a long period of time and results in the development of intelligence studies and estimates.

Operational intelligence is concerned with current or near-term events. It is used to determine the current and projected capability of a program or operation on an ongoing basis and does not result in long-term projections. Most intelligence activities support the development of operational intelligence.

8 0
3 years ago
Mario was surprised that the box that was supposed to tell him how many words he used in his document did not appear after the s
Nookie1986 [14]

Answer:

Click the Display tab

Explanation:

Choose the Word count option to make it visible, within the Display tab dropdown

7 0
3 years ago
Read 2 more answers
Northern Trail Outfitters stores Last Name in a data extension. How should the text file be defined?
Crazy boy [7]

Answer:

d. Text(100)

Explanation:

The data extensions can be defined as the table with the fields of the data about contacts. It can be related to some other data extensions or can be a standalone.

In the context, the Northern Trail Outfitters stores the Last Name in the data extension which is defined as a text file as Text(100).

Choosing a proper field length and a data type ensures an efficient storage as well as retrieval of the data in the data extensions.

7 0
2 years ago
Other questions:
  • What option is used to combine several objects so that they can be treated as a single unit
    6·1 answer
  • How does the use of the computer impact businesses
    13·1 answer
  • In order to install a device, the operating system needs the required __________ for that device.
    13·2 answers
  • You have just read about a new security patch that has been made available for your Windows system, so you install the patch as
    6·1 answer
  • What is an Operating System ??
    7·1 answer
  • How do u type faster
    5·1 answer
  • Explain the main components of a computer system​
    12·1 answer
  • Which of the following is one of the tools in REPL.it that helps prevent syntax errors?
    10·1 answer
  • Which list shows a correct order of mathematical operations that would be used by a spreadsheet formula?
    5·2 answers
  • List the two page orientations in Microsoft word​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!