Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Fall 2022 Home Announcements Grades Harmonize LAPC Tutoring YuJa Verity (Proctoring) Type here to search QH #4 Selection Structures Started: Sep 24 at 2:10pm
Fall 2022 Home Announcements Grades Harmonize LAPC Tutoring YuJa Verity (Proctoring) Type here to search QH #4 Selection Structures Started: Sep 24 at 2:10pm Quiz Instructions Question 5 The JavaScript expression discount == 10 returns true if the number 10 is stored in the variable discount returns false if the number 10 is stored in the variable discount assigns the value 10 to the variable discount will result in an error because you cannot use variable names as operands with comparison operators At TE Not saved 20 pts Submit Quiz 94F Sunny Act Go to Question 3 Imagine you want to write JavaScript code to display a customized message depending on the value of the dessert variable. Which series of words belongs in the blanks (one word per blank)? } (dessert) { "Ice cream": alert("We all scream for ice cream!"); break; "Apple pie": alert ("Full of baked cinnamon-sweet fruit!"); break; "Brownies": alert ("A rich and gooey chocolate treat!"); break; alert (dessert + " is always an excellent choice!"); switch, case, case, case, default if, else if, else if, else if, else case, if, if, if, else 20 pts O switch, dessert, dessert, dessert, default Next Cocor Question 5 Time Running: Hide Attempt due: Sep 25 at 11:5 3 Minutes, 36 Seconds am.laccd.edu/courses/212232/quizzes/1608032/take/questions/33161376 ents ng o search QH #4 Selection Structures Started: Sep 24 at 2:10pm Quiz Instructions Question 2 The following JavaScript code will display the message "You can vote!" if the age variable's value is 40, but will display "When you are 18, you can vote!" if the age variable's value is 4. if (age >= 18) { window.alert ("You can vote!"); } else { window.alert ("When you are 18, you can vote!"); } True False At 20 pts ww Next Questions Questi Quest Questi 94F Sunny Questa Quest Time Running: Attempt due: Sep 2 3 Minutes, 44 S Activate Wind Go to Settings to ac Question 1 Which statement about the following JavaScript code is true? let greeting = "Happy birthday!"; if (ageAtBirthday < 6) {" 11 greeting += You are a cute little kid."; } else if (ageAtBirthday < 40) { greeting += " Have lots of fun!"; else if (ageAtBirthday === 16) { greeting += " You are old enough to drive."; } else { greeting += "You are over the hill!" O This code will cause a runtime error because the curly braces are not positioned correctly. O The else branch is unnecessary because the preceding branches already covered all possible conditions. O The first else if branch [beginning else if (ageAtBirthday < 40) ] will never execute, even if ageAtBirthday is less than 40. O The second else if branch [beginning else if (ageAt Birthday ageAtBirthday equals 16. === 16)] will never execute, even if
Step by Step Solution
★★★★★
3.45 Rating (152 Votes )
There are 3 Steps involved in it
Step: 1
Q 5 The correct answer is returns true if the number 10 is stored in the variable discount Explanati...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started