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 fullNameDisplay "Enter your age in years: "Input ageDisplay "Hi, " + fullNameDisplay "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);
Answer: D
You might also like to view...
If your code contains the following statement:
const int NUMBER_ITEMS = 10; write a statement that creates an array, called initials, of 10 characters:
A core _____ is the widely accepted principle that guides how employees behave and make decisions in the organization?.
A. ?strategy B. ?value C. objective D. ?goal
What is meant by each of the following?
Pixel Kilobyte RGB Loop HSV Flowchart Infinite loop Variable scope Array Matrix JPEG Column-major order Pixelization Luminance
____ is a passive method of receiving WLAN signals.
A. CDMA B. RFMON C. SDIO NOW! D. Sled