Long description

Back

Set 1: Two lines of code are written on the left and seven lines of equivalent code are written at the right. Line 1: forward slash asterisk conditional (ternary) assignment asterisk forward slash. Line 2: foo equals open parenthesis y equals equals 4 close parenthesis question mark open double quotes y is 4 close double quotes colon open double quotes y is not 4 close double quotes semicolon. y equals equals 4 is labeled Condition, y is 4 is labeled Value if true, and y is not 4 is labeled Value if false. Equivalent code: Line 1: forward slash asterisk equivalent to asterisk forward slash. Line 2: StartCommand if EndCommand open parenthesis y equals equals 4 close parenthesis open curly brace. Line 3: foo equals open double quotes y is 4 close double quotes semicolon. Line 4: close curly brace. Line 5: StartCommand else EndCommand open curly brace. Line 6: foo equals open double quotes y is not 4 close double quotes semicolon. Line 7: close curly brace.

Set 2: One line of code is written on the left and eight lines of equivalent code are written at the right. Line 1: StartCommand let EndCommand tip equals isLargeGroup question mark 0.25 colon 0.15 semicolon. Equivalent code: Line 1: forward slash asterisk equivalent to asterisk forward slash. Line 2: StartCommand let EndCommand tip semicolon. Line 3: StartCommand if EndCommand open parenthesis isLargeGroup close parenthesis open curly brace. Line 4: tip equals 0.25 semicolon. Line 5: close curly brace. Line 6: StartCommand else EndCommand open curly brace. Line 7: tip equals 0.15 semicolon. Line 8: close curly brace.

Set 3: One line of code is written on the left and eight lines of equivalent code are written at the right. Line 1: StartCommand let EndCommand price equals isChild question mark 5 colon isSenior question mark 7 colon 9 semicolon. Equivalent code: Line 1: forward slash asterisk equivalent to asterisk forward slash. Line 2: StartCommand let EndCommand price semicolon. Line 3: StartCommand if EndCommand open parenthesis isChild close parenthesis. Line 4: price equals 5 semicolon. Line 5: StartCommand else if EndCommand open parenthesis isSenior close parenthesis. Line 6: price equals 7 semicolon. Line 7: StartCommand else EndCommand. Line 8: price equals 9 semicolon.

Back