Question: please use java script Week 2 - Project Functions a) (10 points) Function that takes parameter Write a function, called it greeting(), so that it

 please use java script Week 2 - Project Functions a) (10
points) Function that takes parameter Write a function, called it greeting(), so
that it takes a parameter and console a greeting. When the program
is ran, it takes a name from the user and use the
input as the parameter to function greeting(). The function should console the
greeting using the user's name. Template This page says Enter a rame
please use java script

Week 2 - Project Functions a) (10 points) Function that takes parameter Write a function, called it greeting(), so that it takes a parameter and console a greeting. When the program is ran, it takes a name from the user and use the input as the parameter to function greeting(). The function should console the greeting using the user's name. Template This page says Enter a rame Prompt window asks the user to enter a name OK Carvel This page says Enter a rame: If user types and enters Peter Pan Peter Pan OK Cancel Medin.120000 ORNO ALLOR The program consoles a message as: Elements Console Sources Filter ) top JS PROJECT a) Good evening Peter Pan 1 b) (20 points) Function that takes parameters For this exercise, create a function called checkName() that handles situation that happens if the user clicks cancel on the prompt, or does not enter text in the prompt. If the user does one of those two actions, have the checkName() function to log to the console a message "You didn't write a name!". Otherwise, have the console log Welcome to the class! Template This page says Enter a name! Prompt window asks the user to enter a name OK Cancel This page says Enter a name: Maria Ng If user types and enters Maria Ng Cancel top The program console a message as: Elements Console Sources Filter JS PROJECT a) Good evening Peter Pan b) Welcome Maria Ng to the class! On the other hand, if the program is ran again and the user do not type a name and click OK or Cancel, the program consoles a message as: Elements Console Sources top Filter JS PROJECT a) Good evening Peter Pan b) You didn't write a name c) (10 points) Function that takes parameters and returns values Now, write a program that takes a number from the user and pass it to function checkNum(). Function checkNum() checks if user entered a number and return a true. Otherwise, checkNum() returns a false Template This page says Enter a number: OK Cancel This page says Enter a number: If the user types and enters a number, for example-12 -121 OK Cancel The program consoles a message as: Per Elements Console Network Sources top Filter c) Did the user enter a number (true or false)? true On the other hand, if the program is ran again and the user types and enters Peter Pan, This page says Enter a number: Peter Pan OK Cancel The program consoles a message as: Elements Console Sources Netygork Pe top Filter c) Did the user enter a number (true or false)? false

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!