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

5.11 LAB: Palindrome A palindrome is a word or a phrase that is the same when read both forward and backward. Examples are: "bob

," "sees," or "never odd or even" (ignoring spaces). Write a program whose input is a word or phrase, and that outputs whether the input is a palindrome.
Computers and Technology
1 answer:
Jet001 [13]3 years ago
7 0

Answer:

The following are the program in the C++ Programming Language.

// set the header file

#include <iostream>

#include <string>

//set the namespace

using namespace std;

//declare boolean type function

bool Palindrome(string s)  

{

 //set the for loop  

 for (int i = 0; i < s.length(); ++i)  

 {

   //check that s[i] is not equal to length

   if (s[i] != s[s.length() - i - 1])  

   {  

     //then, return false

     return false;

   }

 }

 return true;

}

//declare the main function

int main()  

{

 //declare string type variable

 string st;

 //get string type input in that variable

 getline(cin, st);

 //check the following function is returns true

 if (Palindrome(st))  

 {

   //then, return the following result with message

   cout << st << " is a palindrome" << endl;

 }  

 //otherwise

 else  

 {

   //return the following result with message

   cout << st << " is not a palindrome" << endl;

 }

 return 0;

}

<u>Output</u>:

bob

bob is a palindrome

Explanation:

<u>The following are the description of the program</u>.

  • Set the required header files and namespace then, declare function 'Palindrome()' and pass the string type argument 's' in its parameter.
  • Then, set the for loop statement that iterates from 0 and end at the length of the string, set the if conditional statement that checks the s[i] is not equal to its length, then it returns false otherwise returns true.
  • Finally, declare the main function in which we set the string data type variable 'st' and get the string data type input from the user in it.
  • Then, set the if conditional statement that checks the following function returns true or false.
You might be interested in
11111 Power 2 sovle ​
erastovalidia [21]
123,454,321. you just multiply 11111 by itself
4 0
3 years ago
What is the maximum amount of memory that vmachine1 can use in its current configuration with startup ram set to 1024 megabytes?
lidiya [134]

The answer is 1024MB.

I am really not in a position to answer this question fully since the lab is not provided but according to the research conducted online, the answer is 1024MB. According to the book, based on the physical memory installed on the PC, the current system shows 1.06GB which is equivalent to 1060MB. Thus, it is able to use all 1024MB.






7 0
3 years ago
How does beamforming improve network service?
fenix001 [56]

Beamforming can improve network service by using device locations to better target service signals.

This is because, beamforming helps to deliver higher signal quality to the target receiver.

<h3>What is beamforming?</h3>

beamforming can be regarded as application of different radiating elements that is transmitting the same signal.

This signal is usually identical in wavelength and phase, and  by reinforcing the waves in a specific direction the goal can be acheived.

Learn more about beamforming at:

brainly.com/question/12809344

7 0
3 years ago
In the electric series, which one of the following materials is the most negatively charged? A. Silk B. Sealing wax C. Teflon D.
Snowcat [4.5K]
C) Teflon (:


Good luck!
7 0
4 years ago
Read 2 more answers
Which is a requirement for searching for a template
Lina20 [59]

Answer:

umm... you did not discribe the anwsers, i cannot help you

8 0
3 years ago
Other questions:
  • Define the missing function. licenseNum is created as: (100000 * customID) + licenseYear. Sample output:
    10·2 answers
  • A network administrator is required to upgrade wireless access to end users in a building. To provide data rates up to 1.3 Gb/s
    12·1 answer
  • These items describe guidelines for the effective use of presentation graphics. Graphics should be large enough to be seen by th
    9·1 answer
  • 1. What runs horizontally and is identified with numbers?
    12·2 answers
  • When using the Common Internet File System (CIFS), which security model does not require a password to be set for the file share
    7·1 answer
  • Justice wrote a program and forgot to put the steps in the correct order. Which step does she need to review?
    5·2 answers
  • Write a program that reads a file that contains only integers, but some of the integers have embedded commas, as in 145,020. The
    10·1 answer
  • You saved a file on drive C go your computer. You want to find and open the file. Which of the following programs will you use t
    14·1 answer
  • Why would you use a computer's secondary memory?
    12·1 answer
  • What is another term used for next generation firewalls
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!