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
A recursive method without a special terminating case would _________. Hint: Self Check 13.3 had infinite number of isLucky() me
asambeis [7]

Answer:

You need exit condition like If, otherwise method will repeat endlessly.

7 0
3 years ago
Write a function called countstuff () that takes as a parameter a character array, and returns an int. The prototype must be:
PSYCHO15rus [73]

Answer:

Please kindly go to the explanation part.

Explanation:

The required function is written in Raw code below.

Function:

#include<stdio.h>

#include<ctype.h> //including required libraries

int countstuff(char s[]){ //Function countstuff

int cntUp=0,cntLow =0,cntDigits = 0,i=0,value; //declaring required variables

for(i=0;s[i]!='\0';i++){ //loop to iterate over the characters of string

if(isupper(s[i])){

cntUp++; //incrementing count of uppercase if it is uppercase character

}

else if(islower(s[i])){

cntLow++; //incrementing count of lowercase if it is lowercase character

}

else if(isdigit(s[i])){

cntDigits++; //incrementing count of digits if it is digit

}

}

value = cntUp*1000000 + cntLow*1000 + cntDigits; //counting value using formula given in question

return value; //returning the value

}

void main(){

char string[1000]; //declaring required variables

int value;

printf("Enter a String:");

scanf("%[^\n]s",string); //taking string as input

value = countstuff(string); //calling function

printf("The Value is : %d\n",value); //printing result

}

5 0
3 years ago
Give five examples of top level domain​
coldgirl [10]

Answer:  .com — Commercial businesses.

.org — Organizations (generally charitable).

.net — Network organizations.

.gov — U.S. government agencies.

.mil — Military.

.edu — Educational facilities, like universities.

Explanation:

5 0
3 years ago
Read 2 more answers
Are sql injections legal?
natima [27]

Essentially, if you are seen to be someone who knows what you are doing, then even typing in a single-quote to a web form has been enough to be arrested and charged over in the past.

But lets say i'm writing a pen test tool that will be doing sqli testing and let it loose on sites that are 'out in the wild'. I'm not going to be doing dumps of any information. But is just the vulnerability scan itself illegal?



8 0
3 years ago
____ privileges for data involve establishing who can enter new data, change existing data, delete unwanted data, and view data.
Stolb23 [73]
Administrator privileges
6 0
3 years ago
Other questions:
  • What are the challenges of photographing at night? Why did the photographer “paint” the waterfall with the flashlight?
    9·1 answer
  • What is the difference between an electronic notebook and electronic flash cards?
    8·1 answer
  • You work in the Accounting Department and have been using a network drive to post Excel workbook files to your file server as yo
    9·1 answer
  • The function of the file server is to : 1. store data and software programs that can be used by client computers on the network.
    12·1 answer
  • Define the missing method. licenseNum is created as: (100000 * customID) licenseYear, where customID is a method parameter. Samp
    14·2 answers
  • I get brainlist to whoever can help my computer is doing this and I have class and it’s not working and I got it wet yesterday b
    12·2 answers
  • Which symbol would be used in a flowchart to represent a connection to another part of the flowchart
    5·1 answer
  • Suggest three ways in which celebrating an occasion influences food choices?
    10·2 answers
  • What operating system do most users use?
    13·1 answer
  • Java question
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!