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

Answers

Answer 1

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.


Related Questions

Which symbol is at the beginning and end of a multiline comment block?

Answers

The beginning of a block comment or a multi-line comment is marked by the symbol /* and the symbol */ marks its end.

Question 1 of 10
Which situation best illustrates a trade-off between security and privacy?
O A. Online retailers want access to public consumer information
so they can tailor advertisements to generate more sales.
B. One country uses cyberterrorism to attack another country's
military network and render it defenseless.
O C. A malicious hacker spreads misinformation about an
individual over the internet to humiliate the person.
D. Government and law enforcement want access to encrypted
messaging apps to help fight criminals and terrorists

Answers

Answer:

D. Government and law enforcement want access to encrypted messaging apps to help fight criminals and terrorists.

Explanation:

The explanation is simple: if a messaging application has encryption implemented into its functionality, then it means one of the purposes of that application is maintaining the privacy of the end user.

If a government and the law enforcement under that government want access to encrypted messaging applications with the intention of fighting criminals and terrorists -- which is an altruistic act to maintain security in the country -- this defeats the purpose of maintaining the end user's privacy if the developer(s) of the app were to hand over that data to a government and the law enforcement under them.

This is a famous example of security vs privacy, actually.

In the graph shown here, by what percentage are the number of people in computer occupations in general projected to increase?


21%

26%

10%

12%

In the graph shown here, by what percentage are the number of people in computer occupations in general

Answers

The number of people in computer occupations in general is projected to increase at 12%

The chart

Reading the charts, we have the following entries

Software developer applications = 26%Software developer = 21%Computer occupations = 12%Software developers, system software = 10%

Using the above entries, we can conclude that:

The number of people in computer occupations in general is projected to increase at 12%

Read more about bar charts at:

https://brainly.com/question/25069221

Question: Some of your data in Column C is displaying as hashtags (#) because the column is too narrow. How can you widen Column C just enough to show all the data?

Answers

Some of your data in Column C is displaying as hashtags (#) because the column is too narrow. This column can be widen by right-clicking column C, selecting format cells, and then selecting Best-Fit.

What is Cell Formatting?

Cell formatting allows us to change the way cell data appears in the spreadsheet. This function only alters the way the data is presented, and does not change the value of the data. The formatting options allows for different functions like monetary units, scientific options, dates, times, fractions, and many more.

There are six tabs in the Format Cells dialog box. These include number, alignment, font, border, patterns, and protection. By adjusting these tabs we can change the presentation of data in a cell.

Learn more about Formatting here:

https://brainly.com/question/12441633

#SPJ1

What if is a forecasting game, below are actions on your document and all you have to do is predict what will happen after the action is taken. Write your answer on a separate sheet of paper. 1. Triple click on the paragraph 2. Pressing Ctrl + A 3. Double click within the word 4. Pressing key combinations Shift + arrow key 5. Pressing key combinations Ctrl + End

Help me please​

Answers

Answer:

Where is the question

Explanation:

HOPE IT'S USEFUL

A restaurant recorded the ages of customers on two separate days. You are going to write a program to compare the number of customers in their twenties (ages 20 to 29). What is the missing line of code to count the number of customers in their twenties? customerAges = [13, 3, 11, 24, 35, 25, 15, 18, 1] count20s = 0 if 20 <= item <= 29: count20s = count20s + 1

Answers

Answer:

You will need to implement a for loop ( I am assuming this is java)

Explanation:

int count20s = 0;

for(int x =0; x< customerAges.length;x++){

if(20 <= customerAges[x] && customerAges[x] <= 29){

     count20s++;

}

Which of the following is a common use for spreadsheets?

A.
storing graphical data
B.
planning a monthly budget
C.
formatting text for presentability
D.
verifying data validity

Answers

Storing graphical data or a monthly budget

What other new jobs could be created to help address the reality of climate change?

Answers

The new jobs that could be created to help address the reality of climate change are:

Environmental Engineer. Clean Car Engineer.Environmental Scientist. Conservation Scientist.

What exactly is climate change?

The term climate change is known to be a Long-term changes in temperature and weather patterns are referred to as climate change. These changes could be caused by natural processes, such oscillations in the solar cycle.

Note that human activities are known to be primarily the combustion of fossil fuels like coal, oil, and others are those that have been the primary cause of climate change.

Therefore, The new jobs that could be created to help address the reality of climate change are:

Environmental Engineer. Clean Car Engineer.Environmental Scientist. Conservation Scientist.

Learn more about climate change from

https://brainly.com/question/1789619
#SPJ1

What kind of material is used for DRAM (dynamic random-access memory)?

Answers

The kind of material that is used for DRAM (dynamic random-access memory) is metal-oxide-semiconductor.

What is DRAM?

DRAM was invented in 1968. It is a type of RAM used in modern computers and laptops. It is a type of random access memory. Its name is dynamic random access memory.

Metal-oxide-semiconductor is used in making the transistors and capacitors of the DRAM, which are used to store the data. They hold a bit of the data in these capacitors and transistors.

Thus, the material that is used is metal-oxide-semiconductor to make DRAM (dynamic random-access memory).

To learn more about DRAM, refer to the link:

https://brainly.com/question/20216206

#SPJ1

Write code in MinutesToHours that assigns totalHours with totalMins divided by 60

Given the following code:

Function MinutesToHours(float totalMins) returns float totalHours
totalHours = MinutesToHours(totalMins / 60)
// Calculate totalHours:
totalHours = 0

Function Main() returns nothing
float userMins
float totalHours

userMins = Get next input
totalHours = MinutesToHours(userMins)

Put userMins to output
Put " minutes are " to output
Put totalHours to output
Put " hours." to output

Answers

Answer:

Function MinutesToHours(float totalMins) returns float totalHours

   // Calculate totalHours:

   totalHours = totalMins / 60

   return totalHours

End Function

For this program you will be writing a program that will use if-else or if-elif-else statements. Read-It-All bookstore has a book sales club where customers can earn reward points that can be used for their next purchase. If a customer purchases 0 books, he/she earns 0 points. If a customer purchases 1-3 books, he/she earns 5 points. If a customer purchases 4-6 books, he/she earns 10 points. If a customer purchases 7-8 books, he/she earns 15 points. If a customer purchases 9 books, he/she earns 20 points. If a customer purchases 10 or more books, he/she earns 25 points. Write a program that asks the user to enter their name (Firs

Answers

Answer:

name = input("Enter your name: ")

books = int(input("Enter he number of books you purchased: "))

points = 0

if 1 <= books <= 3:

   points = 5

elif 4 <= books <= 6:

   points = 10

elif 7 <= books <= 8:

   points = 15

elif books == 9:

   points = 20

elif books >= 10:

   points = 25

print(name + " has " + str(points) + " points")

Explanation:

*The code is in Python.

Ask the user to enter the name and number of books purchased

Check the number of books purchased. Depending on the given conditions, set the points s/he earned.

Print the name and points s/he has

Which of the following is not one of the ten steps (as defined by the SBA) in starting a business?
O determine legal structure
O choose a location
O hire employees
O register for taxes

Answers

Hire employees is not one of the ten steps (as defined by the SBA) in starting a business.

The ten steps identified by the SBA (Small Business Associations) are as follows:

Conduct market research.Write a business plan.Fund your business.Choose a business location.Choose a legal structure.Register your business name.Get federal and state tax IDs.Register for state and local taxes.Obtain business licenses and permits.Understand employer responsibilities.

While hiring employees is an important aspect of running a business, it is not included as one of the initial steps defined by the SBA for starting a business. Hiring employees typically comes after establishing the legal and operational foundations of the business, including determining the legal structure, registering for taxes, and obtaining licenses, and permits.

It's worth noting that the specific steps and requirements may vary depending on the country, state, or industry in which you are starting your business. However, the SBA's list provides a general framework and guidelines for aspiring entrepreneurs in the United States. Overall, these steps provide a comprehensive guide for starting a business, ensuring that all legal and financial requirements are met and the company is positioned for success.

know more about Small Business Associations here:

https://brainly.com/question/17219051

#SPJ11

___________ is a global issue and there is a requirement to find out the interdependencies among the customers and suppliers.

Answers

Answer:

Supply chain disruption is a global issue and there is a requirement to find out the interdependencies among the customers and suppliers.

Explanation:

The context suggests we are discussing some type of challenge involving the relationships between customers, suppliers and a larger supply chain. A "global issue" involving "interdependencies among the customers and suppliers" points to potential supply chain disruption or issues in a supply network.

Since there is a "requirement to find out the interdependencies" between customers and suppliers, this suggests we need to identify and analyze how they are connected and dependent upon each other in order to resolve the broader "global issue." This information could then be used to make changes, build resilience or manage risks in the supply chain.

Hope this helps!

Answer:

Internet is global issues

What type of function does a project management tool have that a task management tool does not?

Question 16 options:

file sharing


progress tracking


commenting


budgeting

Answers

The type of function that a project management tool have that a task management tool does not is commenting.

What purposes does a project management tool serve?

Project management tools are a a make up of software made to assist project teams in project planning, project tracking, and project management in order to meet project goals within a given time frame.

Note that the process of overseeing a task throughout its life cycle is known as task management. Planning, testing, tracking, and reporting are all part of it. Both individuals and groups of people can work together and exchange knowledge to attain common goals with the aid of task management.

Learn more about project management from

https://brainly.com/question/27995740
#SPJ1

Someone who expects other team members to work long hours is possibly from a _________ culture.

Participative
Competitive
Cooperative

Answers

Answer:

I'm pretty sure cooperative is the answer.

I hope this helps...

Have a nice day <3

As observed in the electromagnets lab, doubling the number of coils has this effect on the strength of the electromagnet:.

Answers

The electromagnet overcurrent gets stronger as the number of coils is doubled because a stronger magnetic field results from more coils.

The power of an electromagnet doubles with every additional coil .This is because the number of coils controls how much current flows through the electromagnet, and the stronger the magnetic field produced by the electromagnet, the more current that flows. The magnetic field's strength grows according to the number of coils, therefore doubling the coil count doubles the magnetic field's intensity. The electromagnet will be able to retain its strength for a longer period of time since adding coils lengthens the time it takes for the current to dissipate .An electromagnet's strength may be effectively increased by doubling the number of coils.

Learn more about OVERCURRENT here:

brainly.com/question/28314982

#SPJ4

wite a short essay recalling two instance, personal and academic, of when you used a word processing software specifically MS Word for personal use and academic work

Answers

I often use MS Word for personal and academic work. Its features improved productivity. One use of MS Word was to create a professional resume. MS Word offered formatting choices for my resume, like font styles, sizes, and colors, that I could personalize.

What is MS Word

The software's tools ensured error-free and polished work. Using MS Word, I made a standout resume. In school, I often used MS Word for assignments and research papers.

Software formatting aided adherence to academic guidelines. Inserting tables, images, and citations improved my academic work's presentation and clarity. MS Word's track changes feature was invaluable for collaborative work and feedback from professors.

Learn more about MS Word  from

https://brainly.com/question/20659068

#SPJ1

anthill is to ant _________ is as to king

Answers

Answer: palace or castle

Explanation: the anthill is the big place where the ants live and the palace is the big place where the king lives.

the programming language is for visual basic

the programming language is for visual basic

Answers

A code segment that displays a menu of three food items along with a quit
option
while True:
   print("Please choose one of the following options:")
   print("1. Pizza")
   print("2. Chicken")
   print("3. Salad")
   print("4. Quit")
   choice = input("Enter your choice: "

What is code segment?
A code segment, sometimes referred to as a text segment or just text in the computing world, is a section of a computer file that is made up of object code or an equivalent section of the program's address space which contains information about executable commands and directives. When a programme is processed and run, it is often saved in an object-code-based computer file. The code segment is on of the object file's divisions. When the programme is loaded into memory by the loader so that it might be executed and implemented, various memory segments are assigned for a specific use, just as they are for segments in object code-based computer files and segments that are only needed during run time when the programme is being executed.

To learn more about code segment
https://brainly.com/question/25781514
#SPJ13

List three possible ways a company can process your data through
their privacy policy.

Answers

Answer:

A company will only process your personal data when they have a legal basis for doing so.

The legal basis to process personal data will one of the following:

1.For the performance of contract:  for recruitment process, for human resource management, and to manage those carrying out work on behalf of PI.

2.For legal requirement:  to comply with applicable regulatory obligations and employment law.

3.For their legitimate interests: to administer their website, to manage their donations, to carry out research and investigations and to manage volunteer.

How many NOTS points are added to your record for not completely stopping at a stop sign?

Answers

The number of NOTS points added to your record for not completely stopping at a stop sign can vary depending on the location and laws of the jurisdiction where the traffic violation occurred. It is important to note that not stopping fully at a stop sign is a serious safety violation, and it can result in a traffic ticket, fines, and possible points on your driver's license record.

In some jurisdictions, failing to stop at a stop sign can result in a citation for running a stop sign or a similar violation. In other jurisdictions, it may be categorized as a failure to obey traffic signals or a similar violation. The number of NOTS points added to your record, if any, will depend on the specific violation charged and the point system used by the jurisdiction in question.

It's important to note that NOTS points are used to track and measure the driving record of a driver, and they may impact insurance rates and license status. It's always a good idea to familiarize yourself with the laws and regulations in your area and drive safely to reduce the risk of violations and penalties.

Can anyone do this I can't under stand

Can anyone do this I can't under stand
Can anyone do this I can't under stand
Can anyone do this I can't under stand
Can anyone do this I can't under stand
Can anyone do this I can't under stand

Answers

Answer:

I think u had to take notes in class

Explanation:

u have yo write 4 strings

true or false. Two of the main differences between storage and memory is that storage is usually very expensive, but very fast to access.​

Answers

Answer:

False. in fact, the two main differences would have to be that memory is violate, meaning that data is lost when the power is turned off and also memory is faster to access than storage.

differentiate between VDU and computer printing by functionality​

Answers

A Visual Display Unit (VDU) is a computer monitor that is used to display the output from a computer. It is an electronic device that displays text and images on a screen.

On the other hand, computer printing is the process of creating a hard copy of the data stored in a computer by using a printer. A printer is an external device that connects to a computer or other electronic device and is used to produce a physical copy of digital data, such as text, graphics, and images.

In summary, a VDU is a device used for displaying the output of a computer, while a computer printer is an external device used for creating a hard copy of the data stored in a computer. In functionality, a VDU is used for visualizing the output of the computer, while a printer is used for creating a physical copy of the data.

What unit on a digital camera gives added illusions

Answers

Vfx used for visual effects in the creation on any screen.. imagery that does not physically exist in life. Vfx also allow makers of films to create environments, objects, creature,ect..

Write a palindrome tester in Java. a palindrome is any word, phrase, or sentence that reads the same forward and backward.
The following are some well-known palindromes.
Kayak
Desserts I stressed
Able was I ere I saw Elba
Create an advanced version of the PalindromeTester Program so that spaces, numbers, and
punctuations are not considered when determining whether a string is a palindrome. The only characters considered are roman letters, and case is ignored. Therefore, the PalindromeTester program will also, recognize the following palindromes:
A man, a plan, a canal, Panama
Madam, I'm Adam
Desserts, I stressed
Able was I, ere I saw Elba
Never odd(5,7) or even(4,6)
The Palindrome Tester will continue to run until the user enters a blank line. It will then print out how many palindromes were found. The following are sample interactions that occur when running the program .

Answers

Using knowledge in computational language in JAVA it is possible to write a code that create an advanced version of the PalindromeTester Program so that spaces, numbers, and punctuations are not considered when determining whether a string is a palindrome.

Writting the code:

import java.util.Scanner;

public class PalindromeTester {

public static void main(String args[]){

System.out.println("Enter lines to check if the line is Palindrome or not.");

System.out.println("Enter blank line to stop.");

String inputLine = null;

Scanner sc = new Scanner(System.in);

int totalPalindromes = 0;

PalindromeTester pt = new PalindromeTester();

do{

inputLine = sc.nextLine();//read next line

if(inputLine!=null){

inputLine = inputLine.trim();

if(inputLine.isEmpty()){

break;//break out of loop if empty

}

if(pt.isPalindromeAdvanced(inputLine)){

totalPalindromes++; //increase count if palindrome

}

}

}while(true);

sc.close();//close scanner

System.out.println("Total number of palindromes: "+totalPalindromes);

}

/**

ivate boolean isPalindromeAdvanced(String str){

String inputStr = str.toLowerCase();

String strWithLetters = "";

for(char ch: inputStr.toCharArray()){

if(Character.isLetter(ch)){

strWithLetters +=ch;

}

}

boolean isPalindrome = isPalindrome(strWithLetters);

return isPalindrome;

}

/**

private boolean isPalindrome(String str){

boolean isCharMatched = true;

int strSize = str.length();

for(int i = 0; i < strSize; i++){

int indexFromFront = i;

int indexFromBack =(strSize-1) - i;

if(indexFromFront >= indexFromBack){

break;

}

if(str.charAt(indexFromFront) != str.charAt(indexFromBack)){

isCharMatched = false;

break;

}

}

if(isCharMatched)

return true;

return false;

}

}

See more about JAVA at brainly.com/question/12975450

#SPJ1

Write a palindrome tester in Java. a palindrome is any word, phrase, or sentence that reads the same

what is arithmetic unit​

Answers

Answer:

The arithmetic unit is a component of the central processing unit and it allows the computer to perform mathematical calculations

This is what I know about it hope it helps ♡

Which of the following is the best example of a purpose of e-mail?
rapidly create and track project schedules of employees in different locations
easily provide printed documents to multiple people in one location
quickly share information with multiple recipients in several locations
O privately communicate with select participants at a single, common location

Answers

Answer:

The best example of a purpose of email among the options provided is: quickly share information with multiple recipients in several locations.

While each option serves a specific purpose, the ability to quickly share information with multiple recipients in different locations is one of the primary and most commonly used functions of email. Email allows for efficient communication, ensuring that information can be disseminated to multiple individuals simultaneously, regardless of their physical location. It eliminates the need for physical copies or face-to-face interactions, making it an effective tool for communication across distances.

Explanation:

Susan has a sheet with both numerical and textual data. She has to enter the numerical data in currency format. She has to input the textual data in underlined format, and she has to wrap the text. Which formatting options will she use? Susan can use the tab to select options to format numerical data in a spreadsheet. She can use the tab to select the underlining option and the tab to wrap text in a cell or range of cells.

Answers

Answer:

Susan has a sheet with both numerical and textual data. She has to enter the numerical data in currency format. She has to input the textual data in underlined format, and she has to wrap the text. Which formatting options will she use?

Susan can use the [ Numbers ] tab to select options to format numerical data in a spreadsheet. She can use the [ Font Affects ] tab to select the underlining option and the [ Text Alignment ] tab to wrap text in a cell or range of cells.

Im not 100% sure hope this helps

Use Python.
Complete reverse() method that returns a new character array containing all contents in the parameter reversed.
Ex: If the input array is:
['a', 'b', 'c']
then the returned array will be:
['c', 'b', 'a']
import java.util.*;
public class LabProgram {
// This method reverses contents of input argument arr.
public static char[] reverse(char[] arr) {
/* Type your code here. */
}
public static void main(String[] args) {
char [] ch = {'a','b','c'};
System.out.println(reverse(ch)); // Should print cba
}
}

Answers

Answer:

Explanation:

The code in the question is written in Java but If you want it in Python then it would be much simpler. The code below is writen in Python and uses list slicing to reverse the array that is passed as an argument to the function. The test case from the question was used and the output can be seen in the attached image below.

def reverse(arr):

   reversed_arr = arr[::-1]

   return reversed_arr

Use Python. Complete reverse() method that returns a new character array containing all contents in the
Other Questions
what is the type of element characterized by the presence of electrons in the d orbital select all the statements. You can chose three statements !!!!!!! what would happen to tidal ranges if the moon were farther away from the earth? 2. Imagine that a stream of water becomes heavily polluted over time. Predict how you think the following properties would change: pH water hardness nitrate and ammonia levels Select the correct answer from each drop-down menu. Complete the following paragraph about changes to the American landscape that occurred during the 1870s. After the passage of the Homestead Act, settlers flooded to the , where lumber was scarce. Barbed wire enabled these settlers to fence in their lands. As a result, the movements of Native Americans and were severely restricted, and the era of came to an end. if f(x) = 5x-2 and g (x) = 2x + 1 find (f-g) (x) A cell phone company offers it's customers a monthly plan that cost $55 per month plus $0.08 for each minutes used. If regina used 225 minutes in a month, how much will she pay for one math david olson and blaine fowers (1993) found that only around 1 in 10 marriages could be awarded the highest score for overall relationship quality. he described these as vitalized marriages. they were described as being based on a high level of self-disclosure, expression of sentiment, shared beliefs, religious and secular, and Solve for b Step by step explanation, thank you. Graph the line with slope 2 passing through the point (5,2)I am only able to graph 2 points on this graph. I need the answer ASP ILL GIVE EXTRA POINTS Briefly explore the language of the poem 'A Complaint ' by William Wordsworth? Which image illustrates the following A.gametogenesisB.meiosisC.egg production D.all of the above cam plants can keep stomata closed in daytime, reducing water loss. this is possible because they . a) fix co2 into organic acids during the night by pep carboxylase b) use photosystems i and ii during day and night. c) use the enzyme phosphofructokinase, to fix co2 more effectively d) fix co2 into sugars in the bundle-sheath cell 4. [-/14.28 Points] DETAILS ASWSBE14 5.E.032. You may need to use the appropriate appendix table or technology to answer this question. Consider a binomial experiment with n = 10 and p = 0.20. (a) Com 2C7H6O2 + 15O2 14CO2 + 6H2OPhilly reacted 120g of Benzoic acid with a surplus of Oxygen gas. If the reaction produced 60g of Carbon dioxide what was Philly's percent yield? If the atmosphere was much thicker than it is now, how would the sun appear? A. The sun would appear the same. B. The sun would appear blue-violet. C. The sun would appear green-blue. D. The sun would appear red-orange. E. The sun would appear yellow-green. Some people argue that, "each unit of CO2 you put into the atmospherehas less and less of a warming impact. Once the atmosphere reaches asaturation point, additional input of CO2 will not really have any majorimpact. Its like putting insulation in your attic. They give a recommendedamount and after that you can stack the insulation up to the roof and itsgoing to have no impact." Myth or reality? Explain your reasoning. Please help me please help me please during his annual physical examination, a retired airplane mechanic reports noticeable hearing loss. the nurse practitioner prescribes a series of hearing tests to confirm or rule out noise-induced hearing loss, which is classified as a: