Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

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

Managing Your Information How To Design And Create A Textual Database On Your Microcomputer

Authors: Tenopir, Carol, Lundeen, Gerald

1st Edition

1555700233, 9781555700232

More Books

Students also viewed these Databases questions