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
Mekhanik [1.2K]
3 years ago
15

A palindrome is a word or phrase that reads the same both backward and forward. The word ""racecar"" is an example. Create an al

gorithm (sequence of steps) to determine if a word or phrase is a palindrome. Try several different words or phrases to ensure your algorithm can detect the existence of a palindrome properly.
Computers and Technology
1 answer:
oee [108]3 years ago
4 0

Answer:

Algorithm for the above problem:

  1. Take a string from the user input.
  2. store the input string on any variable.
  3. Reverse the string and store it on the other variable.
  4. Compare both strings (character by character) using any loop.
  5. If all the character of the string matched then print that the "Input string is a palindrome".
  6. Otherwise, print "The inputted string is not a palindrome."

Output:

  • If the user inputs "ababa", then it prints that the "Input string is palindrome"
  • If the user inputs "ababaff", then it prints that the "Input string is not palindrome"

Explanation:

  • The above-defined line is a set of an algorithm to check the number is palindrome or not.
  • It is defined in English because the algorithm is a finite set of instructions written in any language used to solve the problem.
  • The above algorithm takes input from the user, compare that string with its reverse and print palindrome, if the match is found.
You might be interested in
What is an insertion point?
Tasya [4]
The answer to that would have to be c I think this is it so a feature bl bl bla
7 0
3 years ago
Given parameters b and h which stand for the base and the height of an isosceles triangle (i.e., a triangle that has two equal s
schepotkina [342]

Answer:

The area of the triangle is calculated as thus:

Area = 0.5 * b * h

To calculate the perimeter of the triangle, the measurement of the slant height has to be derived;

Let s represent the slant height;

Dividing the triangle into 2 gives a right angled triangle;

The slant height, s is calculated using Pythagoras theorem as thus

s = \sqrt{b^2 + h^2}

The perimeter of the triangle is then calculated as thus;

Perimeter = s + s + b

Perimeter = \sqrt{b^2 + h^2} + \sqrt{b^2 + h^2} +b

Perimeter = 2\sqrt{b^2 + h^2} + b

For the volume of the cone,

when the triangle is spin, the base of the triangle forms the diameter of the cone;

Volume = \frac{1}{3} \pi * r^2 * h

Where r = \frac{1}{2} * diameter

So, r = \frac{1}{2}b

So, Volume = \frac{1}{3} \pi * (\frac{b}{2})^2 * h

Base on the above illustrations, the program is as follows;

#include<iostream>

#include<cmath>

using namespace std;

void CalcArea(double b, double h)

{

//Calculate Area

double Area = 0.5 * b * h;

//Print Area

cout<<"Area = "<<Area<<endl;

}

void CalcPerimeter(double b, double h)

{

//Calculate Perimeter

double Perimeter = 2 * sqrt(pow(h,2)+pow((0.5 * b),2)) + b;

//Print Perimeter

cout<<"Perimeter = "<<Perimeter<<endl;

}

void CalcVolume(double b, double h)

{

//Calculate Volume

double Volume = (1.0/3.0) * (22.0/7.0) * pow((0.5 * b),2) * h;

//Print Volume

cout<<"Volume = "<<Volume<<endl;

}

int main()

{

double b, h;

//Prompt User for input

cout<<"Base: ";

cin>>b;

cout<<"Height: ";

cin>>h;

//Call CalcVolume function

CalcVolume(b,h);

//Call CalcArea function

CalcArea(b,h);

//Call CalcPerimeter function

CalcPerimeter(b,h);

 

return 0;

}

3 0
3 years ago
Bye guys imma k.ill myself for real this time.
oksano4ka [1.4K]

Answer:

bro no- why?

Explanation:

7 0
2 years ago
Read 2 more answers
An example of software is a
Veseljchak [2.6K]

Answer: false

Explanation:

5 0
2 years ago
When connecting a trunk link between two switches, it is important to configure the allowed VLANs correctly on either end. If th
Len [333]

Answer: A VLAN mismatch

Explanation:

 The VLAN mismatch is the process when the both ends of the truck line are not connected correctly and properly between the two switches.

  • The configuration of the VLAN is done correctly as it is important to connecting the VLAN on either of the ends for avoiding the VLAN mismatch occurrence.
  • By default the truck allow the VLAN 2094 for traversing the trunk by using the native VLAN in the form of VLAN 1.

Therefore, VLAN mismatch is the correct answer.

4 0
3 years ago
Other questions:
  • Which is the output of the formula =AND(12&gt;6;6&gt;3;3&gt;9)
    6·1 answer
  • One of the original forms of viruses, is usually stored on some form of removable media. When the removable media is connected t
    9·1 answer
  • These tools give presenters more freedom to move about the room and interact with their audience.
    5·2 answers
  • write an algorithm that gets the price for item A plus the quantity purchased. The algorithm prints the total cost, including a
    5·1 answer
  • Help me plase will give brainliest
    12·2 answers
  • Which behavior of the application should the user expect? A user profile has login hour restrictions set to Monday through Frida
    12·1 answer
  • What happens when a computer gets a virus?
    6·2 answers
  • Which Packet Tracer feature do you think will be most helpful for you in learning how to manage a network
    5·1 answer
  • How do you save a document in a format so that any reader can view it?
    5·1 answer
  • Which of the following is a key feature of a relational database?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!