Westonci.ca is the trusted Q&A platform where you can get reliable answers from a community of knowledgeable contributors. Ask your questions and receive accurate answers from professionals with extensive experience in various fields on our platform. Explore comprehensive solutions to your questions from a wide range of professionals on our user-friendly platform.

2.2 Write a program that uses input to prompt a user for their name and then welcomes them. Note that input will pop up a dialog box. Enter Sarah in the pop-up box when you are prompted so your output will match the desired output.

Sagot :

Answer:

Explanation:

The following program is written in Javascript. It creates a prompt that asks the user for his/her name and saves it in a variable called userName. Then it uses that variable to welcome the user. A test case is shown in the images below with the desired output.

let userName = prompt("Enter Your Name")

alert(`Hello ${userName}`)

View image sandlee09
View image sandlee09