Solved

Which of the Following Correctly Converts the Algorithm Below to JavaScript

Question 37

Multiple Choice

Which of the following correctly converts the algorithm below to JavaScript? (Assume that constants for an empty string (ES) and the line break tag (BR) have been declared.)
Display "Enter your full name: "
Input fullName
Display "Enter your age in years: "
Input age
Display "Hi, " + fullName
Display "You are " + age + " years old."


A) fullName = prompt("Enter your full name:",ES) ;
Age = prompt("Enter your age in years:",ES) ;

B) fullName = prompt("Enter your full name:",ES) ;
Age = prompt("Enter your age in years:",ES) ;
Document("Hi, " + fullName + BR) ;
Document("You are " + age + "years old." + BR) ;

C) fullName = prompt("Enter your full name:",ES) ;
Age = prompt("Enter your age in years:",ES) ;
Document.write("Hi, " + fullName + BR) ;

D) fullName = prompt("Enter your full name:",ES) ;
Age = prompt("Enter your age in years:",ES) ;
Document.write("Hi, " + fullName + BR) ;
Document.write("You are " + age + "years old." + BR) ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents