answer.
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
Alexandra [31]
2 years ago
4

The is_palindrome function checks if a string is a palindrome. A palindrome is a string that can be equally read from left to ri

ght or right to left, omitting blank spaces, and ignoring capitalization. Examples of palindromes are words like kayak and radar, and phrases like "Never Odd or Even". Fill in the blanks in this function to return True if the passed string is a palindrome, False if not.
Computers and Technology
1 answer:
Dafna1 [17]2 years ago
3 0

Answer:

#include <iostream>  

using namespace std;  

   

// To check String is palindrome or not  

bool Palindrome(string str)  

{  

   int l = 0, lenght = str.length();  

   

   // Lowercase string  

   for (int i = 0; i < lenght; i++)  

       str[i] = tolower(str[i]);  

   

   // Compares character until they are equal  

   while (l <= lenght) {  

   

       if (!(str[l] >= 'a' && str[l] <= 'z'))  

           l++;  

   

       else if (!(str[lenght] >= 'a' && str[lenght] <= 'z'))  

           lenght--;  

   

       else if (str[l] == str[lenght])  

           l++, lenght--;  

   

       // If characters are not equal(not palindrome ) then return false

       

       else

           return false;  

   }  

   

   // Returns true if sentence is equal (palindrome)  

   return true;  

}  

   

int main()  

{  

   string sentence;  

   getline(cin, sentence) ;  

   if (Palindrome(sentence))  

       cout << "Sentence is palindrome.";  

   else

       cout << "Sentence is not palindrome.";  

   

   return 0;  

}  

Explanation:

You might be interested in
dam is writing a program that: 1) has the user guess a number, and 2) tells the user how many guesses it took to get the correct
Virty [35]

Answer:

Adam had most likely made a logic error.

Explanation:

Adam should check his code for any wrong formulas used or wrong arithmetic symbols.

6 0
2 years ago
Assume a program requires the execution of 50 x 106 FP instructions, 110 x 106 INT instructions, 80 x 106 L/S instructions, and
Molodets [167]

Explanation:

FP - 50 \times 10^6

CPI - 1

INT -110 \times 10^6,

CPI - 1

I/S - 80 \times 10^6 ,

CPI - 4

Branch - 16 \times 10^6

CPI - 2

Clock Speed - 2 \times 10^9

Time(old) =\frac{50 x 10^6 + 110 x 10^6 + 4 x ( 80 x 10^6) + 2 x (16 x 10^ 6)}{2 x 10^9}

Time(old) = 256 \times 10^ {-3}

Time(new) =  \frac{256 \times 10^{-3}}{2}

                = 128 \times 10^{-3}

                =\frac{CPI(new) x [50 x 10^6 + 110 x 10^6 + 4 x ( 80 x 10^6) + 2 x (16 x 10^ 6)]}{2 x 10^9}

                =  128 \times 10^{-3}

CPI(new) = \frac{-206}{50}

               = -4.12

3 0
2 years ago
Workspace How do the following technologies help you in your quest to become a digital citizen: kiosks, enterprise computing, na
adelina 88 [10]

Answer:

1) A kiosk are small platforms that can be used for obtaining information and programming relate to entertainment, transportation, commerce, applications, and other areas. A kiosk is located in busy business areas. With Kiosks, one is able to get answers to important information such as service locations.

2) Enterprise computing is the use of information technologies and computing in organizational setting. Enterprise computing provides improved data security

3) Natural language processing is the artificial intelligence concept that deals with the interaction between man and computer by use of natural language. With natural language processing, it is possible to interact with artificial intelligence application in the same manner we interact with a real person

4) Robotics is concerned with the design construction, and operation of robots. It involves the collaboration of computer science and engineering fields. Robotics provide 24 hours assistance including in inhuman conditions such as low oxygen

5) Virtual Reality (VR) is the creation of easily believable simulation of real life by means of computer technology. With virtual reality, one is able to practice practical  trade skills in their living room

Explanation:

6 0
2 years ago
Lukas entered the date 9-17-2013 in an Excel workbook. He wants the date to appears as “Tuesday, September 17, 2013.” Instead of
Sphinxa [80]
<span>The answer is highlight cells, select the Insert tab, click on the number, select Date from the category box, highlight the correct format, and click OK.</span>
8 0
2 years ago
This program finds the sum and average of three numbers. What are the proper codes for Lines a and b?
Gennadij [26K]

Answer:

The Proper codes in Line a and Line b is given below

average=Sum/3  

print (" Average is = ", average)

Explanation:

In the given question it calculated the sum but the program does not calculate the average of the 3 numbers.The average of the 3 number is calculated by using average=Sum/3   statement so we add this code in Line a then After that print the value of average by using the print function so we add this code in Line b.

4 0
2 years ago
Read 2 more answers
Other questions:
  • A search box does all of the following EXCEPT ________.
    12·2 answers
  • Write a method named lastFirst that accepts a string as its parameter representing a person's first and last name. The method sh
    13·1 answer
  • Tina reported a safety hazard at her workplace to OSHA. Representatives from OSHA
    5·1 answer
  • The function below takes two arguments, a dictionary called dog_dictionary and a list of dog names (strings) adopted_dog_names.
    8·1 answer
  • Define a method named roleOf that takes the name of an actor as an argument and returns that actor's role. If the actor is not i
    8·1 answer
  • What text results in variable white space (blank) texts results In even white space
    9·1 answer
  • Explain working principle of computer?​
    13·1 answer
  • Accenture has partnered with a global construction company that specializes in building skyscrapers. The company wants better ma
    12·1 answer
  • First, open two separate terminal connections to the same machine, so that you can easily run something in one window and the ot
    8·1 answer
  • What should businesses do in order to remain competitive under the current Cloud<br> landscape?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!