Solved

Which of the Following Correctly Converts the Algorithm Below to JavaScript

Question 7

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