16.6k views
0 votes
Var name = prompt("Enter the name to print on your tee-shirt");

while (name.length > 12) {
name = prompt("Too long. Enter a name with fewer than 12 characters.");
}
alert("The name to be printed is " + name.toUpperCase());

What will happen if the user enters Willy Shakespeare at the first prompt?

a. The user will be prompted to enter a different name
b. The alert will display The name to be printed is " + name.toUpperCase()
c. The alert will display The name to be printed is WILLY SHAKESPEARE
d. The alert will display The name to be printed is WILLY SHAKES

User Plamut
by
6.3k points

1 Answer

4 votes

Willy Shakespeare has 17 characters. It's higher than 12,so the output will be Too long. Enter a name with fewer than 12 characters.

Letter a.

User Binball
by
5.6k points