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
atroni [7]
3 years ago
6

4.Write a JavaScript program to find if a given word is a palindrome or not. Word is given by user via prompt command.

Computers and Technology
1 answer:
ad-work [718]3 years ago
4 0

Answer:

Here is the JavaScript program:

function Palindrome(word) {

   return word == word.toLowerCase().split("").reverse().join("") ? true : false; }

inputWord = prompt("Enter a word to check its if its palindrome or not?");  

alert(Palindrome(inputWord));

Explanation:

The function Palindrome takes a word as argument.

 return word == word.toLowerCase().split("").reverse().join("") ? true : false; }

This statement first converts the word, which is a string to lower case letters using toLowerCase() method. Next split() method splits the word string into an array of strings, then reverse() method reverses the this array and join() method joins all the elements of the array back to the string. At last the conditional statement checks if the resultant string (reverse of word) is equal  to the original word (that was input by user). If both the word and its reverse are equal/same then the program outputs true otherwise returns false.

inputWord = prompt("Enter a word to check its if its palindrome or not?");   statement uses prompt command to take input from the user. inputWord holds the word that user enters.

alert(Palindrome(inputWord)); statement calls Palindrome() method by passing the inputWord (word entered by user) to check if the input word is a palindrome or not. alert() method displays an alert box ( a message) with true if the inputWord is a palindrome otherwise it displays false.

You might be interested in
Queues can be represented using linear arrays and have the variable REAR that point to the position from where insertions can be
Levart [38]

Answer:

8

Explanation:

7 0
3 years ago
Documenting Business Requirements helps developers control the scope of the system and prevents users from claiming that the new
tiny-mole [99]

Answer:

The answer is "True".

Explanation:

Industry demands documentation enables developers to monitor the system's range and protects users claims, that somehow the new system will not accomplish their business goals.

  • The main goal of this report is to offer everyone to be transparent, about what should be accomplished and when.  
  • It is the new business plan, that should be outlined in detail, that's why the given statement is true.
3 0
3 years ago
Can somebody help me with this question?
Vaselesa [24]


Designers are also responsible for interactive designs where the content changes as it gets updated, as well as screen interfaces that help people navigate through a lot of information. Interaction design differentiates itself from other kinds of design by adding another consideration: responding to the actions of the viewer or user. Editorial design for web and mobile is the most tangible example, including websites and mobile apps for publication. Some digital design involves the presentation of rapidly changing streaming information, also known as data visualization, creating both interactive and non-interactive interfaces. Product design refers to the 

8 0
3 years ago
Which option best describes top-down design?
MrRissso [65]
A.Breaking fine à large tas kongo anallergique partis
5 0
1 year ago
A method variable a class variable with the same name. a) acquiesces to b) destroys c) overrides d) alters
arlik [135]

Answer:

Option(c) is the correct answer for the given question.

Explanation:

The method variable overrides the class variable name with same name The method variable overrides of the class variable name .

Following are the example in java language

public class Main

{

int b=90; // class varaible or instance varaible

void sum()

{

   int b=34; // method having same name as class varaible name

   b=b+10;

   System.out.println(b); // display b

}

public static void main(String[] args)  // main method

{

 Main ob=new Main(); // craete object

 ob.sum(); // calling method sum

}

}

Output:

44

In this we declared a variable 'b' as int type in class and override this variable in sum() function it means same variable name is declared in function sum() .

acquiesces ,destroys,alters are the wrong for the given question.

So overrides is the correct answer

4 0
3 years ago
Other questions:
  • I need help please?!!!
    15·1 answer
  • A bus topology network is most often deployed as a peer-to-peer network. <br> a. True <br> b. False
    7·1 answer
  • What is the base for a hexadecimal number system?
    11·1 answer
  • Suppose the message 111010 is to be transmitted (beginning with the leftmost bit) using
    6·1 answer
  • Which of these functions may be used with positional arguments? Select four options.
    10·1 answer
  • Brainliest
    13·2 answers
  • RTOS stands for ______ Time Operating System.
    11·1 answer
  • 4.3 Code Practice: Question 1
    12·2 answers
  • Dropbox and Microsoft's OneDrive are both popular applications for storing files. What is a fundamental difference between Dropb
    15·1 answer
  • Which statement best explains the way that similar apps are used in different devices?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!