Welcome to Westonci.ca, the place where your questions find answers from a community of knowledgeable experts. Join our platform to connect with experts ready to provide accurate answers to your questions in various fields. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our 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