Answered step by step
Verified Expert Solution
Link Copied!

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

imageimageimageimage

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

Identify reasons for choosing qualitative methods.

Answered: 1 week ago