// Syntax: // Comment for reader's benefit, not parsed // # Template Number - +100 for each new type of problem, +10 for each new subtype // Learning Objective(s) for this template - when this template should be used // ? // If student gets the answer right, what OTHER objectives should get credit // Usually, counterpoint to the point of the error, say allocation for missing // deallocation, Declaration for out of scope error, assignment for incorrect // referencing, etc. // Make sure there is no overlap between this and antecedents! // : // If student gets the answer wrong, what OTHER objectives should get discredit // Make sure there is no overlap between this and antecedents! // > // The template itself, no double quotes, preceded and succeeded by a single > // > // Type: debug / output / code // Hardness: The student's correct percentage up to which this template will be used // Note: Syntax for learning objectives (in antecedent, ifCorrect, ifWrong) // is dot.separated, with {,} to represent alternates. // e.g., a.{b,c} is a.b and a.c // This is NOT graph structured, i.e., a,{b,c}.d is not accounted for to mean // a.b.d or a.c.d // FUTURE IMPROVEMENTS: // ADD TEMPLATES FOR POSTSTATEMENT FOR BOTH IF AND IFELSE // ADD TEMPLATES FOR DECLARATION/OTHER AS CONDITION OF IF ELSE // POSTSTATEMENT MAKES MOST SENSE WHEN IF CLAUSE IS EXECUTED AND ELSE CLAUSE IS A SIMPLE STATEMENT // CURRENTLY, POSTSTATEMENT ADDED WHEN IF CONDITION FALSE AND ELSE CLAUSE IS A SIMPLE STATEMENT... // IMPLEMENT DANGLING ELSE // for problems with condition such as variable = value, could print value of variable before if // for contrast. // For condition being var declaration, could have debugging problem where var is accessed after the if. // FOR TEMPLATES 835 AND UP - THE EXPLANATION ABOUT EXITING AN IF DOES NOT READ SMOOTHLY - GOES BACK // AND FORTH BETWEEN LINES. // FOR NESTED IF/IF-ELSE TEMPLATES, MAY WANT TO NOT ASK USER TO PRINT INPUT VARS, BUT ONLY // THE CALCULATED VAR - TO REDUCE COGNITIVE LOAD. e.g., if user calcuates index based // on amount and count, ask to print only index, not also amount and count.. // // ------------------------------------------------------------------------------- // The actual learning objectives: // 100 // Selection.ifElse.Condition.Relational.true // Selection.ifElse.Condition.Relational.false // Selection.ifElse.Condition.Declaration.true // Selection.ifElse.Condition.Declaration.false // Selection.ifElse.Condition.Other.true // Selection.ifElse.Condition.Other.false // 250 // Selection.ifElse.ifClause.Simple // Selection.ifElse.ifClause.Compound // Selection.ifElse.elseClause.Simple // Selection.ifElse.elseClause.Compound // 350 // Selection.ifElse.PostStatement // 400 // Selection.ifElse.Nested.Cascading // Selection.ifElse.Nested.Classification // Selection.ifElse.Nested.Random // Selection.ifElse.Nested.DanglingElse // 500 // Selection.ifElse.Multiple // // 600 // Selection.if.Condition.Relational.true // Selection.if.Condition.Relational.false // Selection.if.Condition.Declaration.true // Selection.if.Condition.Declaration.false // Selection.if.Condition.Other.true // Selection.if.Condition.Other.false // 750 // Selection.if.ifClause.Simple // Selection.if.ifClause.Compound // 800 // Selection.if.PostStatement // 825 // Selection.if.Nested // 850 // Selection.if.Multiple // // --------------------------------------------------------------------------- // 100 // Selection.ifElse.Condition.Relational.true // All 6 relational operators, repeated twice // All 4 combinations of simple/compound if and else clauses # 100 Selection.ifElse.Condition.Relational.true ? Selection.ifElse.{ifClause.Simple,elseClause.Simple} > {(){=;if( > )<<;else <<;}} > Type: output Hardness: 20 # 101 Selection.ifElse.Condition.Relational.true ? Selection.ifElse.{ifClause.Compound,elseClause.Simple} > {(){=;if( != ){ = ; <<;} else <<;}} // {(){=;if( != ){<<;<<;} else <<;}} // Simplified for S08 > Type: output Hardness: 30 # 102 Selection.ifElse.Condition.Relational.true ? Selection.ifElse.{ifClause.Simple,elseClause.Compound} > {(){=;if( != )<<;else { = + 1; <<;}}} // {(){=;if( != )<<;else {<<;<<;}}} // Simplified for S08 > Type: output Hardness: 20 # 103 Selection.ifElse.Condition.Relational.true ? Selection.ifElse.{ifClause.Compound,elseClause.Compound} > {(){=;=;if( <= ){<<;<<;}else {<<; <<;}}} > Type: output Hardness: 40 # 104 Selection.ifElse.Condition.Relational.true ? Selection.ifElse.{ifClause.Simple,elseClause.Simple} > {(){=;if( < )<<; else <<;}} > Type: output Hardness: 20 # 105 Selection.ifElse.Condition.Relational.true ? Selection.ifElse.{ifClause.Compound,elseClause.Compound} > {(){=;=;if( >= ){<<;<<;}else {<<;<<;}}} > Type: output Hardness: 40 # 106 Selection.ifElse.Condition.Relational.true ? Selection.ifElse.{ifClause.Compound,elseClause.Simple} > {(){=;if( < ){ = - 1; <<;}else <<;}} // {(){=;if( < ){<<;<<;}else <<;}} // Simplified for S08 > Type: output Hardness: 30 # 107 Selection.ifElse.Condition.Relational.true ? Selection.ifElse.{ifClause.Simple,elseClause.Compound} > {(){=;=;if( >= )<<;else { = ; <<;}}} // {(){=;=;if( >= )<<;else {<<;<<;}}} // Simplified for S08 > Type: output Hardness: 30 # 108 Selection.ifElse.Condition.Relational.true ? Selection.ifElse.{ifClause.Simple,elseClause.Simple} > {(){=; = + ;if( == * 2)<<; else <<;}} > Type: output Hardness: 30 # 109 Selection.ifElse.Condition.Relational.true ? Selection.ifElse.{ifClause.Simple,elseClause.Compound} > {(){=;=;if( <= )<<; else { = + ; <<;}}} // {(){=;=;if( <= )<<; else {<<;<<;}}} // Simplified for S08 > Type: output Hardness: 30 # 110 Selection.ifElse.Condition.Relational.true ? Selection.ifElse.{ifClause.Compound,elseClause.Compound} > {(){=;if( > ){<<;<<;} else {<<;<<;}}} > Type: output Hardness: 30 # 111 Selection.ifElse.Condition.Relational.true ? Selection.ifElse.{ifClause.Compound,elseClause.Simple} > {(){=; = * 2;if( - == ){<<; = + 1;} else <<;}} // {(){=; = * 2;if( - == ){<<;<<;} else <<;}} // Simplified for S08 > Type: output Hardness: 40 // Selection.ifElse.Condition.Relational.false *********************** 125 // All 6 relational operators, repeated twice // With Vs Without PostStatement // All 4 combinations of simple/compound if and else clauses # 125 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Simple,elseClause.Simple} > {(){=;if( < )<<; else <<; }} > Type: output Hardness: 30 # 126 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Compound,elseClause.Simple} > {(){=;=;if( == ){ = + 1; <<;}else <<;}} // {(){=;=;if( == ){<<;<<;}else <<;}} // Simplified for S08 > Type: output Hardness: 30 # 127 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Simple,elseClause.Compound} > {(){=;if( > )<<;else{=;<<;}}} // {(){=;if( > )<<;else{=;<<;}<<;}} // Simplified for S08 > Type: output Hardness: 30 # 128 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Compound,elseClause.Compound} > {(){=;=;if( <= ){<<;<<;}else{<<;<<;}}} // {(){=;=;if( <= ){<<;<<;}else{<<;<<;}<<;}} // Simplified for S08 > Type: output Hardness: 40 # 129 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Simple,elseClause.Simple} > {(){=; = - ;if( != 0)<<;else <<;}} > Type: output Hardness: 30 # 130 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Compound,elseClause.Simple} > {(){=;=;if( >= ){ = ; <<;}else <<;}} // {(){=;=;if( >= ){<<;<<;}else <<;}} // Simplified for S08 > Type: output Hardness: 40 # 131 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Simple,elseClause.Compound} > {(){=;if( < )<<;else{=;<<;}}} // {(){=;if( < )<<;else{=;<<;}<<;}} // Simplified for S08 > Type: output Hardness: 30 # 132 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Compound,elseClause.Compound} > {(){=;=;if( == ){<<; = ; }else{<<; = ; }}} // {(){=;=;if( == ){<<;<<;}else{<<;<<;}<<;}} // Simplified for S08 > Type: output Hardness: 40 # 133 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Simple,elseClause.Simple} > {(){=;if( > )<<;else <<;}} > Type: output Hardness: 30 # 134 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Compound,elseClause.Simple} > {(){=;=;if( <= ){ = + 1; <<;}else <<;}} // {(){=;=;if( <= ){<<;<<;}else <<;}} // Simplified for S08 > Type: output Hardness: 40 # 135 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Simple,elseClause.Compound} > {(){=; = * 2;if( != + )<<;else{<<; = + 1;}}} // {(){=; = * 2;if( != + )<<;else{<<;<<;}<<;}} // Simplified for S08 > Type: output Hardness: 30 # 136 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Compound,elseClause.Compound} > {(){=;=;if( >= ){<<;<<;}else{<<;<<;}}} // {(){=;=;if( >= ){<<;<<;}else{<<;<<;}=;<<;}} // Simplified for S08 > Type: output Hardness: 40 # 137 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Compound,elseClause.Simple} > {(){=;if( < ){ = + 1; <<;}else <<;}} // {(){=;if( < ){<<;<<;}else <<;<<;}} // Simplified for S08 > Type: output Hardness: 30 # 138 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Simple,elseClause.Compound} > {(){=;=;if( == )<<;else{ = ; <<;}}} // {(){=;=;if( == )<<;else{<<;<<;}}} // Simplified for S08 > Type: output Hardness: 20 # 139 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Compound,elseClause.Compound} > {(){=;if( > ){ = + 1; <<;}else{=;<<;}}} // {(){=;if( > ){<<;<<;}else{=;<<;}}} // Simplified for S08 > Type: output Hardness: 30 # 140 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Simple,elseClause.Simple} > {(){=;=;=;if( <= )<<;else <<;}} // {(){=;=;=;if( <= )<<;else <<; <<;}} // Simplified for S08 > Type: output Hardness: 40 # 141 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Compound,elseClause.Compound} > {(){=; = + ;if( / 2 != ){<<;<<;}else{<<;<<;}}} > Type: output Hardness: 30 # 142 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Simple,elseClause.Simple} > {(){=;=;if( >= )<< + 1;else << ;}} // {(){=;=;if( >= )<<;else <<;<< + 1;}} // Simplified for S08 > Type: output Hardness: 40 # 143 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Compound,elseClause.Compound} > {(){=;=;if( < ){<<;<<;}else{<<;<<;}}} > Type: output Hardness: 30 # 144 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Simple,elseClause.Simple} > {(){=;if( == )<<; else <<; }} // {(){=;if( == )<<; else <<; <<;}} // Simplified for S08 > Type: output Hardness: 40 # 145 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Compound,elseClause.Simple} > {(){=;if( > ){ = + 1; <<;}else <<;}} // {(){=;if( > ){<<;<<;}else <<;<<;}} // Simplified for S08 > Type: output Hardness: 30 # 146 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Simple,elseClause.Compound} > {(){=;=;if( <= )<<;else{<<; = ;}}} // {(){=;=;if( <= )<<;else{<<;<<;}}} // Simplified for S08 > Type: output Hardness: 20 # 147 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Compound,elseClause.Simple} > {(){=; = * 2;if( + != ){ = ; <<;}else<<;}} // {(){=; = * 2;if( + != ){<<;<<;}else<<;<<;}} // Simplified for S08 > Type: output Hardness: 40 # 148 Selection.ifElse.Condition.Relational.false ? Selection.ifElse.{ifClause.Simple,elseClause.Compound} > {(){=;=;if( >= )<<;else{ <<; = + 1;}}} // {(){=;=;if( >= )<<;else{<<;<<;}}} // Simplified for S08 > Type: output Hardness: 20 // Selection.ifElse.Condition.Declaration.true // Selection.ifElse.Condition.Declaration.false // Selection.ifElse.Condition.Other.true // Selection.ifElse.Condition.Other.false // 250 // Selection.ifElse.ifClause.Simple // Selection.ifElse.ifClause.Compound // Selection.ifElse.elseClause.Simple // Selection.ifElse.elseClause.Compound // 350 // Selection.ifElse.PostStatement // Selection.ifElse.Nested.Cascading **************************************************** 400 // Cascading if Vs else // Alternate simple and compound statements # 400 // ph value Selection.ifElse.Nested.Cascading ? Selection.ifElse.{ifClause.Simple,elseClause.{Simple,Compound}} > {(){=;;if( < 7) = -1; else {if( == 7 ) = 0; else = 1;} <<;}} // {(){=;;if( < 7) = -1; else {if( == 7 ) = 0; else = 1;} <<; <<;}} // Simplified for S08 > Type: output Hardness: 70 # 401 // solid, liquid, gas temperatures of water Selection.ifElse.Nested.Cascading ? Selection.ifElse.{ifClause.Simple,elseClause.{Simple,Compound}} > {(){=;;if( <= 0) = 0; else {if( < 100 ) = 1; else = 2;} <<;}} // {(){=;;if( <= 0) = 0; else {if( < 100 ) = 1; else = 2;} <<; <<;}} // Simplified for S08 > Type: output Hardness: 70 # 402 // Month -> Season Selection.ifElse.Nested.Cascading ? Selection.ifElse.{ifClause.Compound,elseClause.Compound} > {(){=;;if( >= 10){ = 4;} else {if( >= 7 ){ = 3;} else {if( >= 4){ = 2;} else { = 1;}}} <<;}} // {(){=;;if( >= 10){ = 4;} else {if( >= 7 ){ = 3;} else {if( >= 4){ = 2;} else { = 1;}}} <<; <<;}} // Simplified for S08 > Type: output Hardness: 70 # 403 // Degrees and quadrants Selection.ifElse.Nested.Cascading ? Selection.ifElse.{ifClause.Compound,elseClause.Compound} > {(){=;;if( <= 90){ = 1;} else {if( <= 180 ){ = 2;} else {if( <= 270){ = 3;} else { = 4;}}} <<;}} // {(){=;;if( <= 90){ = 1;} else {if( <= 180 ){ = 2;} else {if( <= 270){ = 3;} else { = 4;}}} <<; <<;}} // Simplified for S08 > Type: output Hardness: 70 # 404 // Credits -> year Selection.ifElse.Nested.Cascading ? Selection.ifElse.{ifClause.Simple,elseClause.{Simple,Compound}} > {(){=;;if( <= 28) = 1; else{ if( <= 58 ) = 2; else{ if( <= 85 ) = 3; else = 4;}} <<; }} // {(){=;;if( <= 28) = 1; else{ if( <= 58 ) = 2; else{ if( <= 85 ) = 3; else = 4;}} <<; <<; }} // Simplified for S08 > Type: output Hardness: 70 # 405 // Grade -> GPA Selection.ifElse.Nested.Cascading ? Selection.ifElse.{ifClause.Simple,elseClause.{Simple,Compound}} > {(){=;;if( >= 90) = 4; else {if( >= 80 ) = 3; else{ if( >= 70 ) = 2; else {if( >= 55 ) = 1; else = 0;}}} <<; }} // {(){=;;if( >= 90) = 4; else {if( >= 80 ) = 3; else{ if( >= 70 ) = 2; else {if( >= 55 ) = 1; else = 0;}}} <<; <<; }} // Simplified for S08 > Type: output Hardness: 70 # 406 // leap year Selection.ifElse.Nested.Cascading ? Selection.ifElse.{ifClause.Compound,elseClause.Compound} > {(){=;;if( % 4 == 0){if( % 100 == 0 ){if( % 400 == 0){ = 1;}else { = 0;}} else { = 1;}} else{ = 0;} <<;}} // {(){=;;if( % 4 == 0){if( % 100 == 0 ){if( % 400 == 0){ = 1;}else { = 0;}} else { = 1;}} else{ = 0;}<<; <<;}} // Simplified for S08 > Type: output Hardness: 70 # 407 // slope based on deltax and deltay Selection.ifElse.Nested.Cascading ? Selection.ifElse.{ifClause.Simple,elseClause.{Simple,Compound}} > {(){=;=;;if( == 0) = 0; else {if( == ) = 1; else{ if( < ) = -2; else = 2;}} <<; }} // {(){=;=;;if( == 0) = 0; else {if( == ) = 1; else{ if( < ) = -2; else = 2;}}<<;<<;<<; }} // Simplified for S08 > Type: output Hardness: 70 # 408 // Tsunami scale Selection.ifElse.Nested.Cascading ? Selection.ifElse.{ifClause.Simple,elseClause.{Simple,Compound}} > {(){=;; if( <= 72) = 0; else {if( <= 112 ) = 1; else {if( <= 157 ) = 2; else {if( <= 206 ) = 3; else {if( <= 260 ) = 4; else {if( <= 318 ) = 5; else = 6;}}}}} <<;}} // {(){=;; if( <= 72) = 0; else {if( <= 112 ) = 1; else {if( <= 157 ) = 2; else {if( <= 206 ) = 3; else {if( <= 260 ) = 4; else {if( <= 318 ) = 5; else = 6;}}}}} <<; <<;}} // Simplified for S08 > Type: output Hardness: 70 # 409 // frequency vs decible scale Selection.ifElse.Nested.Cascading ? Selection.ifElse.{ifClause.Simple,elseClause.{Simple,Compound}} > {(){=;; if( <= 200) = 20; else {if( <= 2000 ) = 40; else {if( <= 20000 ) = 60; else {if( <= 200000 ) = 80; else = 100;}}} <<;}} // {(){=;; if( <= 200) = 20; else {if( <= 2000 ) = 40; else {if( <= 20000 ) = 60; else {if( <= 200000 ) = 80; else = 100;}}} <<;<<;}} // Simplified for S08 > Type: output Hardness: 70 # 410 // Frequencies and colors (in reverse order of VBGYOR) Selection.ifElse.Nested.Cascading ? Selection.ifElse.{ifClause.Simple,elseClause.{Simple,Compound}} > {(){=;; if( < 482) = 1; else {if( < 503 ) = 2; else {if( < 520 ) = 3; else {if( < 610 ) = 4; else {if( < 659 ) = 5; else = 6;}}}} <<;}} // {(){=;; if( < 482) = 1; else {if( < 503 ) = 2; else {if( < 520 ) = 3; else {if( < 610 ) = 4; else {if( < 659 ) = 5; else = 6;}}}}<<;<<;}} // Simplified for S08 > Type: output Hardness: 70 # 411 // Plant hardiness zone based on low temperature Selection.ifElse.Nested.Cascading ? Selection.ifElse.{ifClause.Simple,elseClause.{Simple,Compound}} > {(){=;; if( < -50) = 1; else {if( < -40 ) = 2; else {if( < -30 ) = 3; else {if( < -20 ) = 4; else {if( < -10 ) = 5; else {if( < 0 ) = 6; else {if( < 10) = 7; else {if( < 20) = 8; else{if( < 30) = 9; else {if( < 40 ) = 10; else = 11;}}}}}}}}} <<;}} // {(){=;; if( < -50) = 1; else {if( < -40 ) = 2; else {if( < -30 ) = 3; else {if( < -20 ) = 4; else {if( < -10 ) = 5; else {if( < 0 ) = 6; else {if( < 10) = 7; else {if( < 20) = 8; else{if( < 30) = 9; else {if( < 40 ) = 10; else = 11;}}}}}}}}} <<; <<;}} // Simplified for S08 > Type: output Hardness: 70 // temperature and type of candy: 235-240 soft 245-250 firm 250-265 hard ball 270-290 soft crack 300-310 hard crack 320-356 caramelized // Selection.ifElse.Nested.Classification *************************************************** 425 // 4-way // 8-way # 425 // movie admission fee: age, show Selection.ifElse.Nested.Classification ? Selection.ifElse.{ifClause.{Simple,Compound},elseClause.{Simple,Compound}} > {(){=;=;;if( <= 9){if( <= 2 ) = 4; else = 6;}else {if( <= 2 ) = 8; else = 10; } <<;}} // {(){=;=;;if( <= 9){if( <= 2 ) = 4; else = 6;}else {if( <= 2 ) = 8; else = 10; } <<; <<; <<;}} // Simplified for S08 > Type: output Hardness: 80 # 426 // quartile of a number 1-100 Selection.ifElse.Nested.Classification ? Selection.ifElse.{ifClause.{Simple,Compound},elseClause.{Simple,Compound}} > {(){=;;if( >= 50){if( < 75 ) = 3; else = 4;}else {if( < 25) = 1; else = 2; } <<;}} // {(){=;;if( >= 50){if( < 75 ) = 3; else = 4;}else {if( < 25) = 1; else = 2; } <<; <<;}} // Simplified for S08 > Type: output Hardness: 80 # 427 // two numbers, operations based on their positive/negative nature Selection.ifElse.Nested.Classification ? Selection.ifElse.{ifClause.Compound,elseClause.Compound} > {(){=;=;;if( >= 0){if( >= 0){ = + ;}else{ = ;}}else{if( >= 0){ = ;}else{ = 0;}} <<;}} // {(){=;=;;if( >= 0){if( >= 0){ = + ;}else{ = ;}}else{if( >= 0){ = ;}else{ = 0;}} <<;<<;<<;}} // Simplified for S08 > Type: output Hardness: 80 # 428 // cards in a hand Selection.ifElse.Nested.Classification ? Selection.ifElse.{ifClause.Compound,elseClause.Compound} > {(){=;=;;if( <= 10){if( <= 2){ = 15;}else{ = 25;}}else{if( == 1){ = 30;}else{ = 50;}} <<;}} // {(){=;=;;if( <= 10){if( <= 2){ = 15;}else{ = 25;}}else{if( == 1){ = 30;}else{ = 50;}} <<; <<; <<;}} // Simplified for S08 > Type: output Hardness: 80 # 429 // positive/negative, odd even Selection.ifElse.Nested.Classification ? Selection.ifElse.{ifClause.{Simple,Compound},elseClause.{Simple,Compound}} > {(){=;;if( >= 0){if( % 2 == 0 ) = 4; else = 3;}else {if( % 2 == 0 ) = 2; else = 1; } <<;}} // {(){=;;if( >= 0){if( % 2 == 0 ) = 4; else = 3;}else {if( % 2 == 0 ) = 2; else = 1; } <<; <<;}} // Simplified for S08 > Type: output Hardness: 80 # 430 // Rent based on no. of bedrooms and bathrooms Selection.ifElse.Nested.Classification ? Selection.ifElse.{ifClause.{Simple,Compound},elseClause.{Simple,Compound}} > {(){=;=;;if( == 2){if( == 1 ) = 1200; else = 1500;}else {if( == 3 ){if( == 1 ) = 1500; else = 1800;} else{if( <= 2 ) = 2100; else = 2500;}} <<; }} // {(){=;=;;if( == 2){if( == 1 ) = 1200; else = 1500;}else {if( == 3 ){if( == 1 ) = 1500; else = 1800;} else{if( <= 2 ) = 2100; else = 2500;}}<<;<<;<<; }} // Simplified for S08 > Type: output Hardness: 80 # 431 // ice-cream: scoops, toppings Selection.ifElse.Nested.Classification ? Selection.ifElse.{ifClause.{Simple,Compound},elseClause.{Simple,Compound}} > {(){=;=;;if( == 1){if( == 0 ) = 100; else = 150;}else {if( == 2 ){if( == 0 ) = 180; else = 220;} else{if( == 0 ) = 250; else = 300;}} <<; }} // {(){=;=;;if( == 1){if( == 0 ) = 100; else = 150;}else {if( == 2 ){if( == 0 ) = 180; else = 220;} else{if( == 0 ) = 250; else = 300;}}<<;<<;<<; }} // Simplified for S08 > Type: output Hardness: 80 # 432 // speeding tickets: speed, age Selection.ifElse.Nested.Classification ? Selection.ifElse.{ifClause.{Simple,Compound},elseClause.{Simple,Compound}} > {(){=;=;;if( <= 10){if( <= 21 ) = 80; else{ if( <= 25 ) = 60; else = 50;}} else {if( <= 30 ){if( <= 21 ) = 120; else{ if( <= 25 ) = 100; else = 80;}} else {if( <= 21 ) = 200; else{ if( <= 25 ) = 150; else = 120;}}} <<; }} // {(){=;=;;if( <= 10){if( <= 21 ) = 80; else{ if( <= 25 ) = 60; else = 50;}} else {if( <= 30 ){if( <= 21 ) = 120; else{ if( <= 25 ) = 100; else = 80;}} else {if( <= 21 ) = 200; else{ if( <= 25 ) = 150; else = 120;}}}<<;<<;<<; }} // Simplified for S08 > Type: output Hardness: 80 # 433 // Income tax rate Selection.ifElse.Nested.Classification ? Selection.ifElse.{ifClause.{Simple,Compound},elseClause.{Simple,Compound}} > {(){=;=;;if( == 0){if( <= 30 ) = 15; else{ if( <= 80 ) = 30; else = 40;}} else {if( <= 40 ) = 10; else {if( <= 100 ) = 25; else = 35;}} <<;}} // {(){=;=;;if( == 0){if( <= 30 ) = 15; else{ if( <= 80 ) = 30; else = 40;}} else {if( <= 40 ) = 10; else {if( <= 100 ) = 25; else = 35;}} <<; <<; <<;}} // Simplified for S08 > Type: output Hardness: 80 # 434 // sorting 3 numbers Selection.ifElse.Nested.Classification ? Selection.ifElse.{ifClause.Compound,elseClause.Compound} > {(){=;=;=; if( > ){if( > ) {<<; <<; <<;} else {if( > ) {<<; <<; <<;} else {<<;<<;<<;} }} else {if( > ) { if( > ) {<<; <<; <<;} else {<<; <<; <<;} } else {<<; <<; <<;}}}} > Type: output Hardness: 80 // Heading N/E/W/S and turn L/R/Around - new heading // Selection.ifElse.Nested.Random *********************************** 450 // // Selection.ifElse.Nested.DanglingElse ***************************** 475 // Selection.ifElse.Multiple ***************************************** 500 // 2 Vs 3 statements // 2 levels - TT, TF, FT, FF // 3 levels - TTT, TTF, TFT, TFF, FTT, FTF, FFT FFF // (Same variable Vs different variables, all 6 relational operators) - NO postStatement, Compound Vs Simple mixed # 500 // 2 levels - TT, positive and negative numbers Selection.ifElse.Multiple ? Selection.ifElse.{Condition.Relational.true,ifClause.{Simple,Compound},elseClause.{Simple,Compound}} > {(){=;=;if( > ) <<; else {<<;}; if( - >= 0){ = - ;} else = - ; << ;}} > Type: output Hardness: 60 # 501 // 2 levels - TF, Selection.ifElse.Multiple ? Selection.ifElse.{Condition.Relational.{true,false},ifClause.{Simple,Compound},elseClause.{Simple,Compound}} > {(){=; = ;if( > ){<<; <<;} else {<<;<<;} = - ; = + ; if( > ) <<; else <<; }} > Type: output Hardness: 60 # 502 // 2 levels - FT, Selection.ifElse.Multiple ? Selection.ifElse.{Condition.Relational.{true,false},ifClause.{Simple,Compound},elseClause.{Simple,Compound}} > {(){=; if( >= ) {<<;} else <<; = * ; if( <= ) <<; else {<<;}}} > Type: output Hardness: 60 # 503 // 2 levels - FF, -ve numbers Selection.ifElse.Multiple ? Selection.ifElse.{Condition.Relational.false,ifClause.{Simple,Compound},elseClause.{Simple,Compound}} > {(){=; = * -1; if( == )<<;else <<; = * ; = * ; if( != ){ <<;} else {<<;} }} // {(){=; = * -1; if( == )<<;else <<; = * ; = * ; if( != ){ <<;} else {<<; <<;} }} // Simplified for S08 > Type: output Hardness: 60 // TTT - a < b, b < c, c < d // a,b,c < x // TTF - a < x, y, z // with vs without accumulator variable // print smaller // a == b == c or a != b != c # 505 // 3 levels - TTT Selection.ifElse.Multiple ? Selection.ifElse.{Condition.Relational.true,ifClause.{Simple,Compound},elseClause.{Simple,Compound}} > {(){=;=;=;if( < )<< ; else << ; if( <= ) << ; else << ; if( < ) {<<;} else {<<;}}} > Type: output Hardness: 60 # 506 // 3 levels - TTF Selection.ifElse.Multiple ? Selection.ifElse.{Condition.Relational.{true,false},ifClause.{Simple,Compound},elseClause.{Simple,Compound}} > {(){=;if( > )<< ; else {<< - ;} if( >= ) << ; else {<< - ;} if( >= ){ << - ;} else <<; }} > Type: output Hardness: 60 # 507 // 3 levels - TFT - <, >, != Selection.ifElse.Multiple ? Selection.ifElse.{Condition.Relational.{true,false},ifClause.{Simple,Compound},elseClause.{Simple,Compound}} > {(){=; = * -1; if( < ) <<; else <<; if( + != 0){ << + ;} else { <<;} if( * == * ) {<< * ;} else { << + ;}}} // {(){=; = * -1; if( < ) <<; else <<; if( + != 0){ << + ;} else { <<; <<;} if( * == * ) {<< * ;} else { << * ; << * ;}}} // Simplified for S08 > Type: output Hardness: 60 # 508 // 3 levels - TFF - Selection.ifElse.Multiple ? Selection.ifElse.{Condition.Relational.{true,false},ifClause.{Simple,Compound},elseClause.{Simple,Compound}} > {(){=;=; if( != ){<<;}else <<; = ; if( == ) << ; else <<; if( == ) {<<;} else {<<;}}} > Type: output Hardness: 60 # 509 // 3 levels - FFF Selection.ifElse.Multiple ? Selection.ifElse.{Condition.Relational.false,ifClause.{Simple,Compound},elseClause.Compound,PostStatement} > {(){=; = 0; if( >= ) = - 1; else { = + 1;} if( >= ) { = - 1; } else { = + 1;} if( >= ) = - 1; else { = + 1;} <<;}} // {(){=; = 0; if( >= ) << ; else {<<; = + 1;} if( >= ) { <<; } else {<<; = + 1;} if( >= )<<; else {<<; = + 1;} <<;}} // Simplified for S08 > Type: output Hardness: 70 # 510 // 3 levels - FTT - Selection.ifElse.Multiple ? Selection.ifElse.{Condition.Relational.{true,false},ifClause.Compound,elseClause.{Simple,Compound},PostStatement} > {(){=;=; = 0;if( >= ){ = + 2;} else = - 1; =; if( >= ){ = + 2;} else = - 1; if( >= ) { = + 2;} else { = - 1;} <<;}} // {(){=;=; = 0;if( >= ){<< ; = + 1;} else << ; =; if( >= ){ << ; = + 1;} else << ; if( >= ) {<<; = + 1;} else {<<;} <<;}} // Simplified for S08 > Type: output Hardness: 70 # 511 // 3 levels - NOT FFT, but Sieve of Eratosthenes Selection.ifElse.Multiple ? Selection.ifElse.{Condition.Relational.{true,false},ifClause.Simple,elseClause.Simple} > {(){=;=; if( > ) = - ; else = - ; <<; <<; if( > ) = - ; else = - ; <<; <<; if( > ) = - ; else = - ; <<; <<; }} > Type: output Hardness: 80 # 512 // 3 levels - NOT FTF, but divide/subtract based on even/odd Selection.ifElse.Multiple ? Selection.ifElse.{Condition.Relational.{true,false},ifClause.Simple,elseClause.Simple} > {(){=; if( % 2 == 0){ = / 2;} else = - 1; <<; if( % 2 == 0){ = / 2;} else = - 1; <<; if( % 2 == 0){ = / 2;} else = - 1; <<;}} > Type: output Hardness: 80 // 600 // Selection.if.Condition.Relational.true **************************** 600 // All six relational operators // Simple Vs Compound if-clause // PostStatement not very effective when condition is true - equivalent to sequential execution # 600 Selection.if.Condition.Relational.true ? Selection.if.ifClause.Simple > {(){=;if( > )<<;}} > Type: output Hardness: 10 # 601 Selection.if.Condition.Relational.true ? Selection.if.ifClause.Simple > {(){=;if( != )<<;}} > Type: output Hardness: 10 # 602 Selection.if.Condition.Relational.true ? Selection.if.ifClause.Simple > {(){=;if( < )<<;}} > Type: output Hardness: 10 # 603 Selection.if.Condition.Relational.true ? Selection.if.ifClause.Simple > {(){=;=;if( >= )<<;}} > Type: output Hardness: 20 # 604 Selection.if.Condition.Relational.true ? Selection.if.ifClause.Simple > {(){=; = + ;if( == * 2)<<;}} > Type: output Hardness: 20 # 605 Selection.if.Condition.Relational.true ? Selection.if.ifClause.Simple > {(){=;=;if( <= )<<;}} > Type: output Hardness: 20 # 610 Selection.if.Condition.Relational.true ? Selection.if.ifClause.Compound > {(){=;if( > ){<<; = ;}}} // {(){=;if( > ){<<;<<;}}} // Simplified for S08 > Type: output Hardness: 20 # 611 Selection.if.Condition.Relational.true ? Selection.if.ifClause.Compound > {(){=;if( != ){<<; = + 1;}}} // {(){=;if( != ){<<;<<;}}} // Simplified for S08 > Type: output Hardness: 20 # 612 Selection.if.Condition.Relational.true ? Selection.if.ifClause.Compound > {(){=;if( < ){<<; = - 1;}}} // {(){=;if( < ){<<;<<;}}} // Simplified for S08 > Type: output Hardness: 20 # 613 Selection.if.Condition.Relational.true ? Selection.if.ifClause.Compound > {(){=;=;if( >= ){<< - ; = ;}}} // {(){=;=;if( >= ){<<;<<;}}} // Simplified for S08 > Type: output Hardness: 30 # 614 Selection.if.Condition.Relational.true ? Selection.if.ifClause.Compound > {(){=; = * 2;if( - == ){<<; = + 1;}}} // {(){=; = * 2;if( - == ){<<;<<;}}} // Simplified for S08 > Type: output Hardness: 30 # 615 Selection.if.Condition.Relational.true ? Selection.if.ifClause.Compound > {(){=;=;if( <= ){<< - ; = ;}}} // {(){=;=;if( <= ){<<;<<;}}} // Simplified for S08 > Type: output Hardness: 30 // Selection.if.Condition.Relational.false ************************************** 625 // All six relational operators // Simple Vs Compound if-clause // With Vs without PostStatement # 625 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Simple > {(){=;if( < )<<;}} > Type: output Hardness: 10 # 626 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Simple > {(){=;if( == )<<;}} // {(){=;if( == )<<;<<;}} // Simplified for S08 > Type: output Hardness: 20 # 627 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Simple > {(){=;if( > )<<;}} > Type: output Hardness: 10 # 628 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Simple > {(){=;=;if( <= )<<;}} // {(){=;=;if( <= )<<;<<;}} // Simplified for S08 > Type: output Hardness: 20 # 629 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Simple > {(){=; = + ;if( != * 2)<<;}} > Type: output Hardness: 20 # 630 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Simple > {(){=;=;if( >= )<<;}} // {(){=;=;if( >= )<<;<<;}} // Simplified for S08 > Type: output Hardness: 20 # 631 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Compound > {(){=;if( < ){ = - 1; <<;}}} // {(){=;if( < ){<<;<<;}<<;}} // Simplified for S08 > Type: output Hardness: 30 # 632 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Compound > {(){=;if( == ){<<; <<;}}} // {(){=;if( == ){<<;<<;}}} // Simplified for S08 > Type: output Hardness: 20 # 633 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Compound > {(){=;if( > ){<<; = ;}}} // {(){=;if( > ){<<;<<;}<<;}} // Simplified for S08 > Type: output Hardness: 30 # 634 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Compound > {(){=;=;if( <= ){ = ; <<;}}} // {(){=;=;if( <= ){<<;<<;}}} // Simplified for S08 > Type: output Hardness: 20 # 635 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Compound > {(){=; = * 2;if( - != ){ = ; <<;}}} // {(){=; = * 2;if( - != ){<<;<<;}<<;}} // Simplified for S08 > Type: output Hardness: 30 # 636 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Compound > {(){=;=;if( >= ){<<; = ;}}} // {(){=;=;if( >= ){<<;<<;}}} // Simplified for S08 > Type: output Hardness: 20 # 637 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Simple > {(){=;if( < )<<;}} // {(){=;if( < )<<;<<;}} // Simplified for S08 > Type: output Hardness: 20 # 638 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Simple > {(){=;if( == )<<;}} > Type: output Hardness: 10 # 639 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Simple > {(){=;if( > )<<;}} // {(){=;if( > )<<;<<;}} // Simplified for S08 > Type: output Hardness: 20 # 640 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Simple > {(){=;=;if( <= )<<;}} > Type: output Hardness: 10 # 641 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Simple > {(){=; = + ;if( != * 2)<<;}} // {(){=; = + ;if( != * 2)<<;<<;}} // Simplified for S08 > Type: output Hardness: 20 # 642 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Simple > {(){=;=;if( >= )<<;}} > Type: output Hardness: 10 # 643 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Compound > {(){=;if( < ){<<; = ;}}} // {(){=;if( < ){<<;<<;}}} // Simplified for S08 > Type: output Hardness: 20 # 644 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Compound > {(){=;if( == ){<<; = + ;}}} // {(){=;if( == ){<<;<<;}<<;}} // Simplified for S08 > Type: output Hardness: 30 # 645 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Compound > {(){=;if( > ){<<; = - ;}}} // {(){=;if( > ){<<;<<;}}} // Simplified for S08 > Type: output Hardness: 20 # 646 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Compound > {(){=;=;if( <= ){ = ; <<;}}} // {(){=;=;if( <= ){<<;<<;}<<;<<;}} // Simplified for S08 > Type: output Hardness: 30 # 647 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Compound > {(){=; = * 2;if( - != ){<<; = ;}}} // {(){=; = * 2;if( - != ){<<;<<;}}} // Simplified for S08 > Type: output Hardness: 20 # 648 Selection.if.Condition.Relational.false ? Selection.if.ifClause.Compound > {(){=;=;if( >= ){ = + ; <<;}}} // {(){=;=;if( >= ){<<;<<;}<<;<<;}} // Simplified for S08 > Type: output Hardness: 30 // Selection.if.Condition.Declaration.true ******************************* 650 // Boolean Vs Integer condition variable // Simple Vs Compound if-clause // With Vs without PostStatement # 650 Selection.if.Condition.Declaration.true ? Selection.if.ifClause.Simple > {(){if( = true)<< ;}} > Type: output Hardness: 40 # 651 Selection.if.Condition.Declaration.true ? Selection.if.ifClause.Simple > {(){ = ;if( = true)<<;}} // {(){ = ;if( = true)<<;<<;}} // Simplified for S08 > Type: output Hardness: 40 # 652 Selection.if.Condition.Declaration.true ? Selection.if.ifClause.Compound > {(){if( = ){<<; = * 2;}}} // {(){if( = ){<<;<< + 1;}}} // Simplified for S08 > Type: output Hardness: 40 # 653 Selection.if.Condition.Declaration.true ? Selection.if.ifClause.Compound > {(){ = ;if( = ){ = ; <<;}}} // {(){ = ;if( = ){<<;<<;}<<;}} // Simplified for S08 > Type: output Hardness: 40 # 654 Selection.if.Condition.Declaration.true ? Selection.if.ifClause.Simple > {(){if(=)<<;}} > Type: output Hardness: 40 # 655 Selection.if.Condition.Declaration.true ? Selection.if.ifClause.Simple > {(){=;if(=)<<;}} // {(){=;if(=)<<;<<;}} // Simplified for S08 > Type: output Hardness: 40 # 656 Selection.if.Condition.Declaration.true ? Selection.if.ifClause.Compound > {(){if( = true){<<;}}} > Type: output Hardness: 40 # 657 Selection.if.Condition.Declaration.true ? Selection.if.ifClause.Compound > {(){=;if( = true){<<; = * 2;}}} // {(){=;if( = true){<<;<<;}<<;}} // Simplified for S08 > Type: output Hardness: 40 // Selection.if.Condition.Declaration.false ****************************** 675 // Boolean Vs Integer condition variable // Simple Vs Compound if-clause // With Vs without PostStatement # 675 Selection.if.Condition.Declaration.false ? Selection.if.ifClause.Simple > {(){if( = false)<<;}} > Type: output Hardness: 40 # 676 Selection.if.Condition.Declaration.false ? Selection.if.ifClause.Simple > {(){=;if( = false)<<;}} // {(){=;if( = false)<<;<<;}} // Simplified for S08 > Type: output Hardness: 40 # 677 Selection.if.Condition.Declaration.false ? Selection.if.ifClause.Compound > {(){if( = 0){<<; = + 1;}}} // {(){if( = 0){<<;<< + 1;}}} // Simplified for S08 > Type: output Hardness: 40 # 678 Selection.if.Condition.Declaration.false ? Selection.if.ifClause.Compound > {(){=;if( = 0){ = ; <<;}}} // {(){=;if( = 0){<<;<<;}<<;}} // Simplified for S08 > Type: output Hardness: 40 # 679 Selection.if.Condition.Declaration.false ? Selection.if.ifClause.Simple > {(){if( = 0)<<;}} > Type: output Hardness: 40 # 680 Selection.if.Condition.Declaration.false ? Selection.if.ifClause.Simple > {(){=;if( = 0)<<;}} // {(){=;if( = 0)<<;<<;}} // Simplified for S08 > Type: output Hardness: 40 # 681 Selection.if.Condition.Declaration.false ? Selection.if.ifClause.Compound > {(){if( = false){<<;}}} > Type: output Hardness: 40 # 682 Selection.if.Condition.Declaration.false ? Selection.if.ifClause.Compound > {(){=;if( = false){<<; = ;}}} // {(){=;if( = false){<<;<<;}<<;}} // Simplified for S08 > Type: output Hardness: 40 // Selection.if.Condition.Other.true ************************************* 700 // Condition is: // Literal Constant - integer, boolean // Symbolic Constant? // Assignment to a pre-declared variable // Arithmetic expression - with or without variables, mostly +,- // -ve numbers as true # 700 Selection.if.Condition.Other.true ? Selection.if.ifClause.Simple > {(){=;if()<<;}} > Type: output Hardness: 40 # 701 Selection.if.Condition.Other.true ? Selection.if.ifClause.Simple > {(){=;if( = )<<;}} > Type: output Hardness: 40 # 702 Selection.if.Condition.Other.true ? Selection.if.ifClause.Compound > {(){=;=;if( + ){ = ; <<;}}} // {(){=;=;if( + ){<<; <<;}}} // Simplified for S08 > Type: output Hardness: 40 # 703 Selection.if.Condition.Other.true ? Selection.if.ifClause.Compound > {(){=;if( * -1){ = * -1; <<;}}} // {(){=;if( * -1){<<; << * -1;}}} // Simplified for S08 > Type: output Hardness: 40 # 704 Selection.if.Condition.Other.true ? Selection.if.ifClause.Simple > {(){=;if(true)<<;}} > Type: output Hardness: 40 # 705 Selection.if.Condition.Other.true ? Selection.if.ifClause.Compound > {(){=;=;if( = ){<<; = ;}}} // {(){=;=;if( = ){<<; <<;}}} // Simplified for S08 > Type: output Hardness: 40 # 706 Selection.if.Condition.Other.true ? Selection.if.ifClause.Compound > {(){=;=;if( - ){ = + 1; <<;}}} // {(){=;=;if( - ){<<; <<;}}} // Simplified for S08 > Type: output Hardness: 40 # 707 Selection.if.Condition.Other.true ? Selection.if.ifClause.Simple > {(){=;if()<<;}} > Type: output Hardness: 40 # 708 Selection.if.Condition.Other.true ? Selection.if.ifClause.Compound > {(){=;=;if( - ){ = - 1; <<;}}} // {(){=;=;if( - ){<<; <<;}}} // Simplified for S08 > Type: output Hardness: 40 // Selection.if.Condition.Other.false ************************************ 725 // Literal Constant - integer, boolean // Symbolic Constant? // Assignment to a pre-declared variable // Arithmetic expression - with or without variables, mostly +,- # 725 Selection.if.Condition.Other.false ? Selection.if.ifClause.Simple > {(){=0;if()<<;}} > Type: output Hardness: 40 # 726 Selection.if.Condition.Other.false ? Selection.if.ifClause.Simple > {(){=;if( = 0)<<;}} > Type: output Hardness: 40 # 727 Selection.if.Condition.Other.false ? Selection.if.ifClause.Compound > {(){=;=;if( - ){ = + 1; <<;}}} // {(){=;=;if( - ){<<; <<;}}} // Simplified for S08 > Type: output Hardness: 40 # 728 Selection.if.Condition.Other.false ? Selection.if.ifClause.Simple > {(){=;if(false)<<;}} > Type: output Hardness: 40 # 729 Selection.if.Condition.Other.false ? Selection.if.ifClause.Compound > {(){=;=0;if( = ){ = + 1; <<;}}} // {(){=;=0;if( = ){<<; <<;}}} // Simplified for S08 > Type: output Hardness: 40 # 730 Selection.if.Condition.Other.false ? Selection.if.ifClause.Simple > {(){=;if( * 0)<<; }} > Type: output Hardness: 40 # 731 Selection.if.Condition.Other.false ? Selection.if.ifClause.Compound > {(){=;=;if( / ){ = - 1; <<;}}} // {(){=;=;if( / ){<<; <<;}}} // Simplified for S08 > Type: output Hardness: 40 // 750 // Selection.if.ifClause.Simple // Selection.if.ifClause.Compound // 800 // Selection.if.PostStatement // Selection.if.Nested *************************************** 825 // 2 Vs 3 levels // 2 levels - True-True Vs True-False Vs False-True // 3 levels - TTT, TTF, TFT, FTT // Compound Vs Simple // (Same variable Vs different variables, all 6 relational operators) - NO postStatement // Compound Statement - all are set as compound statements because of problem with indenting code (as described before) # 825 // 2 levels - TT, two var, - number and its square Selection.if.Nested ? Selection.if.{Condition.Relational.true,ifClause.Compound} > {(){=;if( <= ){ = * ; if( >= ){ = + 1; <<;}}}} // {(){=;if( <= ){ = * ; if( >= ){ <<; <<;}}}} // Simplified for S08 > Type: output Hardness: 50 # 826 // 2 levels - TF - one var, Selection.if.Nested ? Selection.if.{Condition.Relational.{true,false},ifClause.Compound} > {(){=;if( >= ){ if( - == 0){ <<;}}}} > Type: output Hardness: 50 # 827 // 2 levels - FT, two vars, sum/difference Selection.if.Nested ? Selection.if.{Condition.Relational.{true,false},ifClause.Compound} > {(){=;=;if( - > 0){ if( + > 0){ <<;}}}} > Type: output Hardness: 50 # 830 // 3 levels - TTT, three vars, var in range Selection.if.Nested ? Selection.if.{Condition.Relational.{true,false},ifClause.Compound} > {(){=;if( <= ){ = + ; if( <= ){ = + ; if( <= ) { = ; <<; }}}}} // {(){=;if( <= ){ = + ; if( <= ){ = + ; if( <= ) { <<; <<; <<;}}}}} // Simplified for S08 > Type: output Hardness: 50 # 831 // 3 levels - TTF, three vars, monotonicity Selection.if.Nested ? Selection.if.{Condition.Relational.{true,false},ifClause.Compound} > {(){=;=; =; = 0; if( >= ){ = + 1; if( >= ){ = + 1; if( >= ){ = + 1;}}} <<;}} // {(){=;=; if( >= ){<<; =; if( >= ){<<; if( >= ){ <<;}}}}} // Simplified for S08 > Type: output Hardness: 50 # 832 // 3 levels - TFT, sum, difference Selection.if.Nested ? Selection.if.{Condition.Relational.{true,false},ifClause.Compound} > {(){=;=;if( != ){ <<; if( - >= 0){<< - ; if( + >= ){ << + ;}}}}} // {(){=;=;if( != ){ <<; <<; if( - >= 0){<< - ; if( + >= ){ << + ;}}}}} // Simplified for S08 > Type: output Hardness: 50 # 833 // 3 levels - FTT Selection.if.Nested ? Selection.if.{Condition.Relational.{true,false},ifClause.Compound} > {(){=;=; = 111;if( == ){ = - 100; if( * >= 0){ = - 10; if( * >= ){ = - 1; }}} <<; }} // {(){=;=;if( == ){ <<; <<; if( * >= 0){ << * ; if( * >= ){ << * ;}}}}} // Simplified for S08 > Type: output Hardness: 50 // Simple Statement - harder than compound statement, hence, later in the template list. # 835 // 2 levels - TT, one var, 2 comparators Selection.if.Nested ? Selection.if.{Condition.Relational.true,ifClause.Simple} > {(){=;if( < ) if( <= ) <<;}} > Type: output Hardness: 50 # 836 // 2 levels - TF - two vars, one comparator Selection.if.Nested ? Selection.if.{Condition.Relational.{true,false},ifClause.Simple} > {(){=;=;if( > ) if( >= ) = ; <<;}} // {(){=;=;if( > ) if( >= ) <<;}} // Simplified for S08 > Type: output Hardness: 50 # 837 // 2 levels - FT, two vars, two comparators Selection.if.Nested ? Selection.if.{Condition.Relational.{true,false},ifClause.Simple} > {(){=;=;if( > ) if( <= ) = ; <<;}} // {(){=;=;if( > ) if( <= ) <<;}} // Simplified for S08 > Type: output Hardness: 50 # 840 // 3 levels - TTT, one var, var in range Selection.if.Nested ? Selection.if.{Condition.Relational.true,ifClause.Simple} > {(){=;if( >= ) if( <= ) if( != ) = ; <<;}} // {(){=;if( >= ) if( <= ) if( != ) <<;}} // Simplified for S08 > Type: output Hardness: 50 # 841 // 3 levels - TTF, three vars, monotonicity Selection.if.Nested ? Selection.if.{Condition.Relational.{true,false},ifClause.Simple} > {(){=;=;=; if( < ) if( <= ) if( <= ) = ; <<;}} // {(){=;=;=; if( < ) if( <= ) if( <= ) <<;}} // Simplified for S08 > Type: output Hardness: 50 # 842 // 3 levels - TFT Selection.if.Nested ? Selection.if.{Condition.Relational.{true,false},ifClause.Simple} > {(){=;=;if( > ) if( >= ) if( + >= ) = ; <<;}} // {(){=;=;if( > ) if( >= ) if( + >= ) <<;}} // Simplified for S08 > Type: output Hardness: 50 # 843 // 3 levels - FTT Selection.if.Nested ? Selection.if.{Condition.Relational.{true,false},ifClause.Simple} > {(){=;=;if( + == 0) if( >= 0) if( <= 0 ) = ; <<;}} // {(){=;=;if( + == 0) if( >= 0) if( <= 0 ) <<;}} // Simplified for S08 > Type: output Hardness: 50 // 850 // Selection.if.Multiple // 2 Vs 3 statements // 2 levels - TT, TF, FT, FF // 3 levels - TTT, TTF, TFT, TFF, FTT, FTF, FFT FFF // (Same variable Vs different variables, all 6 relational operators) - NO postStatement, Compound Vs Simple mixed # 850 // 2 levels - TT, positive and negative numbers Selection.if.Multiple ? Selection.if.{Condition.Relational.true,ifClause.{Simple,Compound}} > {(){=;=;if( > ){<<; = + 1;} if( < 0) <<;}} // {(){=;=;if( > ){<<; <<;} if( + >= 0) << + ;}} // Simplified for S08 > Type: output Hardness: 50 # 851 // 2 levels - TT, <=, >= Selection.if.Multiple ? Selection.if.{Condition.Relational.true,ifClause.{Simple,Compound}} > {(){=;=;if( >= ) <<; if( <= ){ <<;}}} > Type: output Hardness: 50 # 852 // 2 levels - TF, !=, == Selection.if.Multiple ? Selection.if.{Condition.Relational.{true,false},ifClause.{Simple,Compound}} > {(){=;=;if( != )<<; if( - == 0) {<< ; = + 1;}}} // {(){=;=;if( != )<<; if( - == 0) {<< ; << ;}}} // Simplified for S08 > Type: output Hardness: 50 # 853 // 2 levels - FT, >, < Selection.if.Multiple ? Selection.if.{Condition.Relational.{true,false},ifClause.Compound} > {(){=;=;if( > ){<<; <<;} if( < ) {<< ; ;}}} > Type: output Hardness: 50 # 854 // 2 levels - FF, -ve numbers Selection.if.Multiple ? Selection.if.{Condition.Relational.false,ifClause.Simple} > {(){=;if( + > 0)<<; if( - != 0) << ;}} > Type: output Hardness: 50 # 855 // 3 levels - TTT, +, - and / of two integers being > 0 Selection.if.Multiple ? Selection.if.{Condition.Relational.true,ifClause.{Simple,Compound}} > {(){=;=;if( + > 0)<< ; if( - >= 0) << ; if( * > 0 ) {<< + ; = ;}}} // {(){=;=;if( + > 0)<< ; if( - >= 0) << ; if( / > 0 ) {<<; << ;}}} // Simplified for S08 > Type: output Hardness: 50 # 856 // 3 levels - TTF: doubling a number and subtracting itself Selection.if.Multiple ? Selection.if.{Condition.Relational.{true,false},ifClause.Compound} > {(){=;= * 2;= - ;if( != )<< ; if( != ) << ; if( != ) {<< - ; = ;}}} // {(){=;= * 2;= - ;if( != )<< ; if( != ) << ; if( != ) {<<; << ;}}} // Simplified for S08 > Type: output Hardness: 50 # 857 // 3 levels - TFT - <, >, != Selection.if.Multiple ? Selection.if.{Condition.Relational.{true,false},ifClause.Compound} > {(){=;=;if( < ){<<;} if( > ) << ; if( != ) {<< - ; = ;}}} // {(){=;=;if( < ){<<;} if( > ) << ; if( != ) {<<; <<;}}} // Simplified for S08 > Type: output Hardness: 50 # 858 // 3 levels - TFF - Selection.if.Multiple ? Selection.if.{Condition.Relational.{true,false},ifClause.{Simple,Compound}} > {(){=;if( > 0){<<; = - 1;} = - ; if( > 0) << ; if( <= ) {<< - ; = ;}}} // {(){=;if( > 0){<<;} = - ; if( > 0) << ; if( <= ) {<<; <<;}}} // Simplified for S08 > Type: output Hardness: 50 # 859 // 3 levels - FFF Selection.if.Multiple ? Selection.if.{Condition.Relational.false,ifClause.Simple} > {(){=;if( + 1 < * 1) <<; if( + 2 > * 2 ) << + 2; if( + 3 > * 3)<< + 3;}} > Type: output Hardness: 50 # 860 // 3 levels - FTT - monotonicity Selection.if.Multiple ? Selection.if.{Condition.Relational.{true,false},ifClause.{Simple,Compound}} > {(){=;=;if( < ){<<;<<;} = + ;if( < ) << ; if( <= ) {<<; = ;}}} // {(){=;=;if( < ){<<;} = + ;if( < ) << ; if( <= ) {<<; <<;}}} // Simplified for S08 > Type: output Hardness: 50 # 861 // 3 levels - FFT - binary search Selection.if.Multiple ? Selection.if.{Condition.Relational.{true,false},ifClause.{Simple,Compound}} > {(){=;if( > 20){<< - 20; = - 20;} if( > 10) << - 10; if( >= 5) {<<; = + 20;}}} // {(){=;if( > 20){<< - 20;} if( > 10) << - 10; if( >= 5) {<<;}}} // Simplified for S08 > Type: output Hardness: 50 # 862 // 3 levels - FTF - all negative numbers - not sure they will be able to solve this correctly Selection.if.Multiple ? Selection.if.{Condition.Relational.{true,false},ifClause.{Simple,Compound}} > {(){=;=;if( + > 0){<<; <<;} if( - < 0) << ; if( * > 0) {<<; <<;}}} // {(){=;=;if( + > 0){<<;} if( - < 0) << ; if( * > 0) {<<; <<;}}} // Simplified for S08 > Type: output Hardness: 50 //Errors - If/Else Statements // {(){=;;if( > 0){;<<<;<<;}}} // {(){=;=;if( == ){<<'T';}else{;<<;}}} // {(){=;if( == 100){< == 0){<;<<;}}}} //Errors - If Statements // {(){=;if( > 0){=;}<<;}} // {(){=;;if( > 100){<<;}}} // {(){=;if( == ){;<<;}}} //Code Ok - If/Else Statements // {(){=;if( > 0){<<;}else{<<'E';}=;if( < 100){<<;}else{<<;}}} // {(){=;if( > 0){<;}}} // {(){=;=;if( > ){<<;}else{<<;}}} // {(){=;if( < -100){<<'T';}else{<<'F';}}} // {(){=;if( == ){<<;}else{<<;}}} // {(){=;if( > 0){<<;}else{if( < -500){<<'L';}else{<<'H';}}}} // -------------------------------------------------------------------------- // Templates here are for demonstration purposes // Included at the end so that regular practice does not pick up these templates // How to enter an output # 90 Demonstration > {(){=;<<;}} > Type: output Hardness: 10 // How to enter multiple outputs # 91 Demonstration > [,]{(){=;<<;=;<<;<< - ;}} > Type: output Hardness: 10 // How to enter NO output # 92 Demonstration > {(){=;=;; = + ;}} > Type: output Hardness: 10 // --------------------------------------------------------------------------