Question: Conditionals - Lab / Ho mework Use jsfiddle.net or another runner to create and play with the following. After completing each numbered exercise, place all

 Conditionals - Lab / Ho mework Use jsfiddle.net or another runner

Conditionals - Lab / Ho mework Use jsfiddle.net or another runner to create and play with the following. After completing each numbered exercise, place all your code in a document and submit to Moodle for today's lab/homework. 1. Write a script that prompts for two numbers as inputs. Write a conditional using if and else that then displays the larger of the two to the screen 2. Write a conditional using if and else to check if someone's first name is Frank. If the first name is Frank, display "Welcome, Frank" to the screen. If the first name is not Frank, display "You're not Frank" 3. Start with the following variables var x = 2; var y = 4; var z, Write a script that does the following increase the value of x by 10 using shorthand assignment decrease the value of y by 2 using shorthand assignment assign z the value of x and y added together multiply the value of z by 4 using shorthand assignment 4. Write a conditional using a switch statement that uses the following as an input variable var dessert = cake". In the switch statement, compare the input variable to the following values pie, pudding, cake, cobbler If the comparison equals pie display "l like pie" If the comparison equals pudding display "I hate pudding" If the comparison equals cake display "I only like chocolate cake" If the comparison equals cobbler display "I need ice cream" If the comparison doesn't equal anything > display "Unknown dessert" 5. Create an object to use as a lookup table. The table should display the USPS 2-digit abbreviation if the entire US State name is given. For example, if we are looking for Arkansas, it should return AR. You can use this page to find the 50 states plus District of Columbia abbreviations 0 BONUS POINTS 4. Using short-circuit execution in conjunction with if, else if, and else write a script that determines the largest of the following 4 numbers var a = 1; var b = 7; var c = 22; var d = 12

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!