// 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 // ------------------------------------------------------------------------------- // The actual learning objectives: // // 100 - output, changed to debug_output for consistency // Switch.Condition.Matches case // 125 - output, changed to debug_output for consistency // Switch.Condition.Matches default // 150 - output, changed to debug_output for consistency // Switch.Condition.Matches none // 175 - output, changed to debug_output for consistency // Switch.Condition.Expression // // 200 - Done by RWalde - debug_output // Switch.Condition.Switch condition is not an integer expression // 225 - Done by RWalde - debug_output // Switch.Case.Case value is not an integer expression // 250 - Done by RWalde - debug_output // Switch.Case.Case value is not a constant expression // // 300 - output, changed to debug_output for consistency // Switch.Body.No statement // // 325 - debug_output // Switch.Body.No break.Has statements // 350 - debug_output // Switch.Body.No break.No statement // // 400 - output // Switch.Nested // 500 - output // Switch.Multiple // // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // 100 // Switch.Condition.Matches case // Always has default, never used; all cases have break and at least one statement // Case value options: // 1-5 // 5 random values // 50-10 // Body of switch options: // Print random constants // Print an expression involving case value, e.g., monotonic up or exchange // Print an expression involving a variable other than the one in the condition // Assign to a variable, which is printed after the switch // Random value // Value of an expression involving case value // 1-5 cases # 100 Switch.Condition.Matches case > {(){=;switch(){ case 1: << ; break; case 2: << ; break; case 3: << ; break; case 4: << ; break; case 5: << ; break; default: << ; break; }}} > Type: debug_output Hardness: 20 # 101 Switch.Condition.Matches case > {(){=;switch(){ case 1: << + 4; break; case 2: << + 2; break; case 3: << ; break; case 4: << - 2; break; case 5: << - 4; break; default: << * ; break; }}} > Type: debug_output Hardness: 20 # 102 Switch.Condition.Matches case > {(){=;=;switch(){ case 1: << * ; break; case 2: << - ; break; case 3: << + ; break; case 4: << - ; break; case 5: << + ; break; default: << * ; break; }}} > Type: debug_output Hardness: 20 # 103 Switch.Condition.Matches case > {(){=;;switch(){ case 1: = * 10; break; case 2: = + 10; break; case 3: = 0; break; case 4: = + 2; break; case 5: = * 2; break; default: = % 10; break; } << ;}} > Type: debug_output Hardness: 20 // 5 random values for cases # 105 Switch.Condition.Matches case > {(){=;switch(){ case : << ; break; case : << ; break; case : << ; break; case : << ; break; case : << ; break; default: << ; break; }}} > Type: debug_output Hardness: 20 # 106 Switch.Condition.Matches case > {(){=;switch(){ case : << - 20; break; case : << + 20; break; case : << - 10; break; case : << 50 - ; break; case : << + 10; break; default: << + ; break; }}} > Type: debug_output Hardness: 20 # 107 Switch.Condition.Matches case > {(){=;=;switch(){ case : << * ; break; case : << / ; break; case : << + ; break; case : << % ; break; case : << - ; break; default: << * ; break; }}} > Type: debug_output Hardness: 20 # 108 Switch.Condition.Matches case > {(){=;=;switch(){ case : = * 10; break; case : = % ; break; case : = + 10; break; case : = / ; break; case : = - ; break; default: = * ; break; } << ;}} > Type: debug_output Hardness: 20 // cases 50-10 # 110 Switch.Condition.Matches case > // {(){ = * 10;switch(){ case 50: << ; break; case 40: << ; break; case 30: << ; break; case 20: << ; break; case 10: << ; break; default: << ; break; }}} []{(){ = ;switch(){ case 50: << ; break; case 40: << ; break; case 30: << ; break; case 20: << ; break; case 10: << ; break; default: << ; break; }}} > Type: debug_output Hardness: 20 # 111 Switch.Condition.Matches case > // {(){ = * 2;switch(){ case 10: << / 10; break; case 8: << + ; break; case 6: << ; break; case 4: << - ; break; case 2: << * ; break; default: << % 10; break; }}} []{(){ = ;switch(){ case 10: << / 10; break; case 8: << + ; break; case 6: << ; break; case 4: << - ; break; case 2: << * ; break; default: << % 10; break; }}} > Type: debug_output Hardness: 20 # 112 Switch.Condition.Matches case > // {(){ = * 5; = * 10;switch(){ case 25: << - ; break; case 20: << / 10; break; case 15: << / 10; break; case 10: << + ; break; case 5: << - ; break; default: << * ; break; }}} [,]{(){ = ; = ;switch(){ case 25: << - ; break; case 20: << / 10; break; case 15: << / 10; break; case 10: << + ; break; case 5: << - ; break; default: << * ; break; }}} > Type: debug_output Hardness: 20 # 113 Switch.Condition.Matches case > // {(){ = * 10;;switch(){ case 90: = / 10; break; case 80: = - 30; break; case 70: = ; break; case 60: = + 20; break; case 50: = * 2; break; default: = % 10; break; } << ;}} []{(){ = ;;switch(){ case 90: = / 10; break; case 80: = - 30; break; case 70: = ; break; case 60: = + 20; break; case 50: = * 2; break; default: = % 10; break; } << ;}} > Type: debug_output Hardness: 20 // --------------------------------------------------------------------------- // 125 // Switch.Condition.Matches default // 1-5 cases # 125 Switch.Condition.Matches default > {(){=;switch(){ case 1: << ; break; case 2: << ; break; case 3: << ; break; case 4: << ; break; case 5: << ; break; default: << ; break; }}} > Type: debug_output Hardness: 20 # 126 Switch.Condition.Matches default > {(){=;switch(){ case 1: << + ; break; case 2: << % 2; break; case 3: << * 2; break; case 4: << * ; break; case 5: << - ; break; default: << ; break; }}} > Type: debug_output Hardness: 20 # 127 Switch.Condition.Matches default > {(){=;=;switch(){ case 1: << % ; break; case 2: << - ; break; case 3: << * ; break; case 4: << - ; break; case 5: << % ; break; default: << ; break; }}} > Type: debug_output Hardness: 20 # 128 Switch.Condition.Matches default > {(){=;;switch(){ case 1: = + ; break; case 2: = * ; break; case 3: = % 10; break; case 4: = / 3; break; case 5: = ; break; default: = + 1; break; } << ;}} > Type: debug_output Hardness: 20 // 5 random values for cases # 130 Switch.Condition.Matches default > {(){=;switch(){ case : << ; break; case : << ; break; case : << ; break; case : << ; break; case : << ; break; default: << ; break; }}} > Type: debug_output Hardness: 20 # 131 Switch.Condition.Matches default > {(){=;switch(){ case : << - ; break; case : << * ; break; case : << - ; break; case : << + ; break; case : << - ; break; default: << - 40; break; }}} > Type: debug_output Hardness: 20 # 132 Switch.Condition.Matches default > {(){=;=;switch(){ case : << % ; break; case : << / ; break; case : << + ; break; case : << % ; break; case : << / ; break; default: << ; break; }}} > Type: debug_output Hardness: 20 # 133 Switch.Condition.Matches default > {(){=;=;switch(){ case : = / 10; break; case : = % ; break; case : = / ; break; case : = % ; break; case : = * 10; break; default: = ; break; } << ;}} > Type: debug_output Hardness: 20 // cases 50-10 # 135 Switch.Condition.Matches default > // {(){ = * 10;switch(){ case 90: << ; break; case 80: << ; break; case 70: << ; break; case 60: << ; break; case 50: << ; break; default: << ; break; }}} []{(){ = ;switch(){ case 90: << ; break; case 80: << ; break; case 70: << ; break; case 60: << ; break; case 50: << ; break; default: << ; break; }}} > Type: debug_output Hardness: 20 # 136 Switch.Condition.Matches default > // {(){ = * 2;switch(){ case 9: << % 10; break; case 7: << % 2; break; case 5: << * ; break; case 3: << / 10; break; case 1: << * 5; break; default: << / 2; break; }}} []{(){ = ;switch(){ case 9: << % 10; break; case 7: << % 2; break; case 5: << * ; break; case 3: << / 10; break; case 1: << * 5; break; default: << / 2; break; }}} > Type: debug_output Hardness: 20 # 137 Switch.Condition.Matches default > // {(){ = * 10; = * 10;switch(){ case 50: << * 10; break; case 40: << * ; break; case 30: << * 5; break; case 20: << * 2; break; case 10: << * ; break; default: << ; break; }}} [,]{(){ =; = ;switch(){ case 50: << * 10; break; case 40: << * ; break; case 30: << * 5; break; case 20: << * 2; break; case 10: << * ; break; default: << ; break; }}} > Type: debug_output Hardness: 20 # 138 Switch.Condition.Matches default > // {(){ = * 5;;switch(){ case 50: = % 5; break; case 45: = / 10; break; case 40: = % 10; break; case 35: = / 5; break; case 30: = % 2; break; default: = * 2; break; } << ;}} []{(){ = ;;switch(){ case 50: = % 5; break; case 45: = / 10; break; case 40: = % 10; break; case 35: = / 5; break; case 30: = % 2; break; default: = * 2; break; } << ;}} > Type: debug_output Hardness: 20 // --------------------------------------------------------------------------- // 150 // Switch.Condition.Matches none // 1-5 cases # 150 Switch.Condition.Matches none > {(){=;switch(){ case 1: << ; break; case 2: << ; break; case 3: << ; break; case 4: << ; break; case 5: << ; break; }}} > Type: debug_output Hardness: 20 # 151 Switch.Condition.Matches none > {(){ = ;switch(){ case 5: << + ; break; case 6: << - ; break; case 7: << * 2; break; case 8: << % 2; break; case 9: << * ; break; }}} > Type: debug_output Hardness: 20 # 152 Switch.Condition.Matches none > // {(){ = * 10;=;switch(){ case 3: << % ; break; case 4: << % 10; break; case 5: << + ; break; case 6: << - ; break; case 7: << % ; break; } << ;}} []{(){ = ;=;switch(){ case 3: << % ; break; case 4: << % 10; break; case 5: << + ; break; case 6: << - ; break; case 7: << % ; break; } << ;}} > Type: debug_output Hardness: 20 # 153 Switch.Condition.Matches none > // {(){ = * 2;=;switch(){ case 1: = * ; break; case 2: = / 2; break; case 3: = * 10; break; case 4: = % 2; break; case 5: = / ; break; } << ;}} []{(){ =;=;switch(){ case 1: = * ; break; case 2: = / 2; break; case 3: = * 10; break; case 4: = % 2; break; case 5: = / ; break; } << ;}} > Type: debug_output Hardness: 20 // 5 random values for cases # 155 Switch.Condition.Matches none > {(){=;switch(){ case : << ; break; case : << ; break; case : << ; break; case : << ; break; case : << ; break; }}} > Type: debug_output Hardness: 20 # 156 Switch.Condition.Matches none > {(){=;switch(){ case : << - ; break; case : << + ; break; case : << - ; break; case : << - ; break; case : << - ; break; }}} > Type: debug_output Hardness: 20 # 157 Switch.Condition.Matches none > {(){=;=;switch(){ case : = - ; break; case : = / ; break; case : = / ; break; case : = - ; break; case : = - ; break; } << ; }} > Type: debug_output Hardness: 20 # 158 Switch.Condition.Matches none > {(){=;=;switch(){ case : = + ; break; case : = / ; break; case : = % ; break; case : = - ; break; case : = - ; break; } << ;}} > Type: debug_output Hardness: 20 // cases 50-10 # 160 Switch.Condition.Matches none > // {(){ = * 20;switch(){ case 90: << ; break; case 70: << ; break; case 50: << ; break; case 30: << ; break; case 10: << ; break; }}} []{(){ = ;switch(){ case 90: << ; break; case 70: << ; break; case 50: << ; break; case 30: << ; break; case 10: << ; break; }}} > Type: debug_output Hardness: 20 # 161 Switch.Condition.Matches none > {(){ = ;switch(){ case 4: << / 2; break; case 3: << % 2; break; case 2: << * 2; break; case 1: << * 3; break; case 0: << + 5; break; }}} > Type: debug_output Hardness: 20 # 162 Switch.Condition.Matches none > // {(){ = * 10; = ;switch(){ case 55: = * 2; break; case 45: = * 10; break; case 35: = / ; break; case 25: = / 2; break; case 15: = + ; break; } << ; }} []{(){ = ; = ;switch(){ case 55: = * 2; break; case 45: = * 10; break; case 35: = / ; break; case 25: = / 2; break; case 15: = + ; break; } << ; }} > Type: debug_output Hardness: 20 # 163 Switch.Condition.Matches none > // {(){ = * 5;switch(){ case 20: = - 5; break; case 15: = / 5; break; case 10: = % 5; break; case 5: = * 5; break; case 0: = + 5; break; } << ;}} []{(){ = ;switch(){ case 20: = - 5; break; case 15: = / 5; break; case 10: = % 5; break; case 5: = * 5; break; case 0: = + 5; break; } << ;}} > Type: debug_output Hardness: 20 // --------------------------------------------------------------------------- // 175 // Switch.Condition.Expression // Incrementing # 175 Switch.Condition.Expression > // {(){ = ; = 10;switch( + ){ case 11: << ; break; case 12: << ; break; case 13: << - ; break; case 14: << * ; break; case 15: << * ; break; default: << + ; break; }}} [,]{(){ = ; = ;switch( + ){ case : << ; break; case : << ; break; case : << - ; break; case : << * ; break; case : << * ; break; default: << + ; break; }}} > Type: debug_output Hardness: 40 # 176 Switch.Condition.Expression > // {(){ = ; = 10;switch( - ){ case 5: << * 2; break; case 6: << + ; break; case 7: << * 2; break; case 8: << * ; break; case 9: << - ; break; default: << - ; break; }}} [,]{(){ = ; = ;switch( - ){ case : << * 2; break; case : << + ; break; case : << * 2; break; case : << * ; break; case : << - ; break; default: << - ; break; }}} > Type: debug_output Hardness: 40 # 177 Switch.Condition.Expression > // {(){ = ; = 10;switch( * ){ case 10: << + ; break; case 20: << / ; break; case 30: << - ; break; case 40: << ; break; case 50: << ; break; default: << * ; break; }}} [,]{(){ = ; = ;switch( * ){ case : << + ; break; case : << / ; break; case : << - ; break; case : << ; break; case : << ; break; default: << * ; break; }}} > Type: debug_output Hardness: 40 # 178 Switch.Condition.Expression > {(){ = ; = 12;switch( / ){ case 2: = + 3; break; case 3: = - 2; break; case 4: = - ; break; case 6: = * 2; break; case 12: = + ; break; default: = / ; break; } << ; }} > Type: debug_output Hardness: 45 # 179 Switch.Condition.Expression > {(){ = ; = 10;switch( % ){ case 0: = / ; break; case 1: = * ; break; case 2: = + ; break; case 3: = - ; break; case 4: = * ; break; default: = % ; break; } << ; }} // {(){ = ; = 10;switch( % ){ case 0: = / ; break; case 1: = * ; break; case 2: = + ; break; case 3: = - ; break; case 4: = * ; break; case 5: break; case 6: break; default: = % ; break; } << ; }} > Type: debug_output Hardness: 45 // Decrementing # 185 Switch.Condition.Expression > // {(){ = ; = ;switch( + ){ case 6: << / ; break; case 5: << - ; break; case 4: << * ; break; case 3: << - ; break; case 2: << * ; break; default: << + ; break; }}} [,,,,,,]{(){ = ; = ;switch( + ){ case : << ; break; case : << 10 - ; break; case : << * ; break; case : << 10 - ; break; case : << ; break; default: << + ; break; }}} > Type: debug_output Hardness: 40 # 186 Switch.Condition.Expression > // {(){ = ; = ;switch( - ){ case 2: << + ; break; case 1: << ; break; case 0: << * 2; break; case -1: << ; break; case -2: << - ; break; default: << - ; break; }}} [,,,,,,]{(){ = ; = ;switch( - ){ case : << + ; break; case : << ; break; case : << * 2; break; case : << + 10; break; case : << - ; break; default: << - ; break; }}} > Type: debug_output Hardness: 40 # 187 Switch.Condition.Expression > // {(){ = ; = ;;switch( * ){ case 9: = / ; break; case 6: = * 2; break; case 4: = % ; break; case 3: = * 10; break; case 2: = * 5; break; case 1: = + ; break; default: = * ; break; } << ;}} [,,,,,]{(){ = ; = ;;switch( * ){ case : = + 10; break; case : = + 20; break; case : = + 30; break; case : = + 40; break; case : = + 50; break; case : = + 60; break; default: = + 100; break; } << ;}} > Type: debug_output Hardness: 40 # 188 Switch.Condition.Expression > {(){ = ; = 60;;switch( / ){ case 30: = / 10; break; case 20: = * ; break; case 15: = / 2; break; case 12: = * 2; break; case 10: = + ; break; default: = / ; break; } << ; }} > Type: debug_output Hardness: 45 # 189 Switch.Condition.Expression > // {(){ = ; = 10;;switch( % ){ case 0: = ; break; case 1: = * 2; break; case 2: = / 2; break; case 3: = + 2; break; case 4: = / 3; break; default: = % ; break; } << ; }} [,]{(){ = ; = ;;switch( % ){ case 4: = ; break; case 3: = * 10; break; case 2: = ; break; case 1: = + 20; break; case 0: = * 10; break; default: = % ; break; } << ; }} > Type: debug_output Hardness: 45 // --------------------------------------------------------------------------- // 200 // Switch.Condition.Real // Added by Ralph Walde 1/22/2010 // Condition is variable 200- // Cases are increasing and consecutive or multiples of 5/10/100 // Action prints random constant // Action prints expression involving condition variable // Action assings random value to a secondary variable that is printed after the switch // Condition is expression 205- // Cases are increasing and consecutive or multiples of 5/10/100 // Action prints random constant // Action prints expression involving condition variable // Action assings random value to a secondary variable that is printed after the switch // 2 X 2 X 3 combinations of condition (variable vs expression) X cases (increasing versus decreasing) X action (3 types as listed above) // --------------------------------------------------------------------------- // Added by Ralph Walde 1/22/2010 thru 2/7/2010 // 200 - 224 Switch.Condition.Switch condition is not an integer expression // 225 - 249 Switch.Case.Real // 250 - 274 Switch.Case.Case value is not a constant expression // 200 - 224 Switch.Condition.Switch condition is not an integer expression // 200-202 Condition is real variable // Cases are increasing and consecutive or multiples of 5/10/100 // Action prints random constant // Action prints expression involving condition variable // Action assigns random value to a secondary variable that is printed after the switch // 205-207 Condition is expression involving real variable // Cases are increasing and consecutive or multiples of 5/10/100 // Action prints random constant // Action prints expression involving condition variable // Action assigns random value to a secondary variable that is printed after the switch // 210-212 Condition is real variable, Cases are decreasing, three kinds of action // 215-217 Condition is real variable expression, Cases are decreasing, three kinds of action // 200 switch() Cases increase + 10 to + 50, Random case matches, Action - Cases output random constants # 200 Switch.Condition.Switch condition is not an integer expression > [,,,]{(){=;switch(){ case : << ; break; case : << ; break; case : << ; break; case : << ; break; case : << ; break; default: << ; break;}}} > Type: debug_output Hardness: 20 // 201 switch(), Cases increase + 1 to + 5, Random case matches, Cases output expressions of # 201 Switch.Condition.Switch condition is not an integer expression > [,,,]{(){=;switch(){ case : << + 1; break; case : << * 2; break; case : << - 3; break; case : << - 2; break; case : << * ; break; default: << * 2 + 5; break;}}} > Type: debug_output Hardness: 20 // 202 switch(), Cases increase 5 * + 5 to 5 * + 25, A case matches, Cases assign int , output after switch # 202 Switch.Condition.Switch condition is not an integer expression > [,,,]{(){=;=;switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break; }<< ;}} > Type: debug_output Hardness: 20 // 205 switch( + ) Cases increase + 1 to + 5, A case matches, Cases output random constants # 205 Switch.Condition.Switch condition is not an integer expression > [,,]{(){=;switch( + ){ case : << ; break; case : << ; break; case :<< ; break; case : << ; break; case : << ; break; default: << ; break;}}} > Type: debug_output Hardness: 30 // 206 switch( * ), Cases increasing int, A case matches, Cases output expressions of # 206 Switch.Condition.Switch condition is not an integer expression > // {(){=;switch( * ){ case : << 2 * ; break; case : << + 5; break; case : << - 3; break; case : << - 6; break; case : << 2 * + 1; break; default: << 1 + ; break; }}} []{(){=;switch( * ){ case : << 2 * ; break; case : << + 5; break; case : << - 3; break; case : << - 6; break; case : << 2 * + 1; break; default: << 1 + ; break; }}} > Type: debug_output Hardness: 30 // 207 switch(10 * ), Increase cases by 10, A case matches, Cases assign int , output after switch # 207 Switch.Condition.Switch condition is not an integer expression > [,,]{(){=;=;switch( * 10){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break; } << ;}} > Type: debug_output Hardness: 30 // 210 switch() Cases decrease + 50 to + 10, Random case matches, Action - Cases output random constants # 210 Switch.Condition.Switch condition is not an integer expression > [,,,]{(){=;switch(){ case : << ; break; case : << ; break; case : << ; break; case : << ; break; case : << ; break; default: << ; break;}}} > Type: debug_output Hardness: 20 // 211 switch(), Cases decrease + 5 to + 1, Random case matches, Cases output expressions of # 211 Switch.Condition.Switch condition is not an integer expression > [,,,]{(){=;switch(){ case : << 9 - ; break; case : << 2 * ; break; case : << + 1; break; case : << - 2; break; case : << * 3; break; default: << + 4; break;}}} > Type: debug_output Hardness: 20 // 212 switch(), Cases decrease 5 * + 25 to 5 * + 5, A case matches, Cases assign int , output after switch # 212 Switch.Condition.Switch condition is not an integer expression > [,,,]{(){=;=;switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break; }<< ;}} > Type: debug_output Hardness: 20 // 215 switch ( + ) Cases increase + 1 to + 5, A case matches, Cases output random constants # 215 Switch.Condition.Switch condition is not an integer expression > [,,]{(){=;switch( + ){ case : << ; break; case : << ; break; case :<< ; break; case : << ; break; case : << ; break; default: << ; break;}}} > Type: debug_output Hardness: 30 //216 switch( - ) Cases decreasing random int, Matches Default, Cases output expressions of # 216 Switch.Condition.Switch condition is not an integer expression > // {(){=;switch( - ){ case : << * 3; break; case : << + 4; break; case : << - 3; break; case : << 6 - ; break; case : << 2 + ; break; default: << 1 + * 2; break; }}} []{(){=;switch( - ){ case : << * 3; break; case : << + 4; break; case : << - 3; break; case : << 6 - ; break; case : << 2 + ; break; default: << * 2 + 1; break; }}} > Type: debug_output Hardness: 30 // 217 switch(5 * ), Cases decreasing by 5, A case matches, Cases assign int a expression, output after switch # 217 Switch.Condition.Switch condition is not an integer expression > [,,]{(){=;=;switch( * 5){ case : = + ; break; case : = + ; break; case : = + ; break; case : = + ; break; case : = + ; break; default: = + ; break; } << ;}} > Type: debug_output Hardness: 30 // --------------------------------------------------------------------------- // 225 - 249 Switch.Case.Case value is not an integer expression // Added by Ralph Walde 1/22/2010 // 225-227 Case real literal, Condition is int variable, Cases increasing, three kinds of action // 230-232 Case real literal or expression, Condition is int variable expression, Cases increasing, 3 kinds of action // 235-237 Case real literal or expression, Condition is int variable, Cases decreasing, 3 kinds of action // 240-242 Case real literal or expression, Condition is int variable expression, Cases decreasing, 3 kinds of action // 225 One case a literal real, switch() Cases increase + 10 to + 50, Random case matches, Cases output random constants # 225 Switch.Case.Case value is not an integer expression > // [,,,]{(){=;switch(){ case : << ; break; case : << ; break; case : << ; break; case : << ; break; case : << ; break; default: << ; break;}}} [,,]{(){=;switch(){ case : << ; break; case : << ; break; case : << ; break; case : << ; break; case : << ; break; default: << ; break;}}} > Type: debug_output Hardness: 20 // 226 One case a literal real, switch(), Cases increase + 1 to + 5, Random case matches, Cases output expressions of # 226 Switch.Case.Case value is not an integer expression > [,,,]{(){=;switch(){ case : << * 3; break; case : << * 2; break; case : << 9 - ; break; case : << - 2; break; case : << * ; break; default: << 2 * - 6; break;}}} > Type: debug_output Hardness: 20 // 227 One case a literal real, switch(), Cases increase 10 * + 10 to 10 * + 50, A case matches, Cases assign int , output after switch # 227 Switch.Case.Case value is not an integer expression > [,,,]{(){=;=;switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break; }<< ;}} > Type: debug_output Hardness: 20 // 230 One case literal real, Switch( + ), Cases increase + 1 to + 5, A case matches, Cases output random constants # 230 Switch.Case.Case value is not an integer expression > [,,]{(){=;switch( + ){ case : << ; break; case : << ; break; case :<< ; break; case : << ; break; case : << ; break; default: << ; break;}}} > Type: debug_output Hardness: 20 // 231 One case real constant expression, switch( + ), Cases increasing random int, A case matches, Cases output expressions of # 231 Switch.Case.Case value is not an integer expression > // {(){=;switch( + ){ case : << 5 + ; break; case : << - 6; break; case : << 3 * ; break; case : << + 9; break; case + : << 2 * - 3; break; default: << 1 + ; break; }}} {(){=;switch( + ){ case : << 5 + ; break; case : << - 6; break; case : << 3 * ; break; case : << + 9; break; case : << 2 * - 3; break; default: << 1 + ; break; }}} > Type: debug_output Hardness: 20 // 232 One case literal real, switch(10 * ), Cases by 10, A case matches, Cases assign int , output after switch # 232 Switch.Case.Case value is not an integer expression > [,,,]{(){=;=;switch( * 10){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break; } << ;}} > Type: debug_output Hardness: 20 //235 One case a literal real, switch() Cases decrease + 25 to + 5, Random case matches, Cases output random constants # 235 Switch.Case.Case value is not an integer expression > // [,,,]{(){=;switch(){ case : << ; break; case : << ; break; case : << ; break; case : << ; break; case : << ; break; default: << ; break;}}} [,,,]{(){=;switch(){ case : << ; break; case : << ; break; case : << ; break; case : << ; break; case : << ; break; default: << ; break;}}} > Type: debug_output Hardness: 20 // 236 One case a literal real, switch(), Cases decrease + 5 to + 1, Random case matches, Cases output expressions of # 236 Switch.Case.Case value is not an integer expression > [,,,]{(){=;switch(){ case : << * 3; break; case : << * 2; break; case : << 9 - ; break; case : << - 2; break; case : << * ; break; default: << 2 * - 6; break;}}} > Type: debug_output Hardness: 20 // 237 One case a real constant expression, switch(), Cases decrease 10 * + 50 to 10 * + 10, A case matches, Cases assign int , output after switch # 237 Switch.Case.Case value is not an integer expression > // [,,,]{(){=;=;switch(){ case : = ; break; case : = ; break; case : = ; break; case 20 + : = ; break; case : = ; break; default: = ; break; }<< ;}} [,,,]{(){=;=;switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break; }<< ;}} > Type: debug_output Hardness: 20 // 240 One case literal real, Switch( + ), Cases decrease + 5 to + 1, A case matches, Cases output random constants # 240 Switch.Case.Case value is not an integer expression > // [,,]{(){=;switch( + ){ case : << ; break; case : << ; break; case :<< ; break; case : << ; break; case : << ; break; default: << ; break;}}} [,,]{(){=;switch( + ){ case : << ; break; case : << ; break; case :<< ; break; case : << ; break; case : << ; break; default: << ; break;}}} > Type: debug_output Hardness: 20 // 241 One case literal, switch( + ), Cases decreasing random int, A case matches, Cases output expressions of # 241 Switch.Case.Case value is not an integer expression > // {(){=;switch( + ){ case : << - ; break; case : << + ; break; case : << * 2; break; case : << + ; break; case : << 2 * - ; break; default: << + ; break; }}} {(){=;switch( + ){ case : << - ; break; case : << + ; break; case : << * 2; break; case : << + ; break; case : << 2 * - ; break; default: << + ; break; }}} > Type: debug_output Hardness: 20 // 242 One case literal real, switch( * 5), Cases decrease by 5, A case matches, Cases assign int , output after switch # 242 Switch.Case.Case value is not an integer expression > [,,,]{(){=;=;switch( * 5){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break; } << ;}} > Type: debug_output Hardness: 20 // --------------------------------------------------------------------------- // 250 - 274 Switch.Case.Case value is not a constant expression // Added by Ralph Walde 1/22/2010 // 250-252 Case integer variable, Condition is int variable, Cases increasing, three kinds of action // 255-257 Case integer variable or expression, Condition is int variable expression, Cases increasing, 3 kinds of action // 260-262 Case integer variable or expression, Condition is int variable, Cases decreasing, 3 kinds of action // 265-267 Case integer variable or expression, Condition is int variable expression, Cases decreasing, 3 kinds of action // 250 One case an integer variable, switch() Cases increase + 10 to + 50, Random case matches, Cases output random constants # 250 Switch.Case.Case value is not a constant expression > [,,]{(){=;=;switch(){ case : << ; break; case : << ; break; case : << ; break; case : << ; break; case : << ; break; default: << ; break;}}} > Type: debug_output Hardness: 20 // 251 One case an integer variable, switch(), Cases increase + 1 to + 5, Random case matches, Cases output expressions of # 251 Switch.Case.Case value is not a constant expression > [,,]{(){=;=;switch(){ case : << * 2; break; case : << + ; break; case : << - ; break; case : << + ; break; case : << * ; break; default: << 2 * - ; break;}}} > Type: debug_output Hardness: 20 // 252 One case an integer variable, switch(), Cases increase 10 * + 10 to 10 * + 50, A case matches, Cases assign int , output after switch # 252 Switch.Case.Case value is not a constant expression > [,,,]{(){=;=;=;switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break; }<< ;}} > Type: debug_output Hardness: 20 // 255 One case an integer variable, Switch( + ), Cases increase + 1 to + 5, A case matches, Cases output random constants # 255 Switch.Case.Case value is not a constant expression > [,,]{(){=;=;switch( + ){ case : << ; break; case : << ; break; case :<< ; break; case : << ; break; case : << ; break; default: << ; break;}}} > Type: debug_output Hardness: 20 // 256 One case an integer variable, switch( + ), Cases increasing random int, A case matches, Cases output expressions of # 256 Switch.Case.Case value is not a constant expression > // {(){=;=;switch( + ){ case : << + ; break; case : << - ; break; case : << 2 * ; break; case : << + ; break; case : << 2 * + ; break; default: << + ; break; }}} []{(){=;=;switch( + ){ case : << + ; break; case : << - ; break; case : << 2 * ; break; case : << + ; break; case : << 2 * + ; break; default: << + ; break; }}} > Type: debug_output Hardness: 20 // One case an integer variable expression, switch(10 * ), Cases increases by 10, A case matches, Cases assign int , output after switch # 257 Switch.Case.Case value is not a constant expression > // {(){=;=;=20;switch(10 * ){ case 10: = ; break; case 20: = + ; break; case 30: = * 4; break; case 40: = 5 * + ; break; case 3 * - 10: = 3 * + 2; break; default: = + ; break; }<< ;}} [,,,]{(){=;=;=;switch( * 10){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break; } << ;}} > Type: debug_output Hardness: 20 //260 One case an integer variable, switch() Cases decrease + 25 to + 5, Random case matches, Cases output random constants # 260 Switch.Case.Case value is not a constant expression > [,,,]{(){=;=;switch(){ case : << ; break; case : << ; break; case : << ; break; case : << ; break; case : << ; break; default: << ; break;}}} > Type: debug_output Hardness: 20 // 261 One case an integer variable, switch(), Cases decrease + 5 to + 1, Random case matches, Cases output expressions of # 261 Switch.Case.Case value is not a constant expression > [,,,]{(){=;=;switch(){ case : << * 3; break; case : << * 2; break; case : << + ; break; case : << - ; break; case : << * ; break; default: << 2 * - ; break;}}} > Type: debug_output Hardness: 20 // 262 One case an integer variable expression, switch(), Cases decrease 10 * + 50 to 10 * + 10, A case matches, Cases assign int , output after switch # 262 Switch.Case.Case value is not a constant expression > // [,,,]{(){=;=;=;switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case + 10: = ; break; default: = ; break; }<< ;}} [,,,]{(){=;=;=;switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break; }<< ;}} > Type: debug_output Hardness: 20 // 265 One case an integer variable, Switch( + ), Cases decrease + 5 to + 1, A case matches, Cases output random constants # 265 Switch.Case.Case value is not a constant expression > // [,,]{(){=;=;switch( + ){ case : << ; break; case : << ; break; case :<< ; break; case : << ; break; case : << ; break; default: << ; break;}}} [,,]{(){=;=;switch( + ){ case : << ; break; case : << ; break; case :<< ; break; case : << ; break; case : << ; break; default: << ; break;}}} > Type: debug_output Hardness: 20 // 266 One case an integer variable expression, switch( + ), Cases decreasing random int, A case matches, Cases output expressions of # 266 Switch.Case.Case value is not a constant expression > // {(){=;=;switch( + ){ case : << - ; break; case : << + ; break; case : << * 2; break; case : << + ; break; case + 1: << 2 * - ; break; default: << + ; break; }}} {(){=;=;switch( + ){ case : << - ; break; case : << + ; break; case : << * 2; break; case : << + ; break; case : << 2 * - ; break; default: << + ; break; }}} > Type: debug_output Hardness: 20 // 267 One case an integer variable, switch( * 5), Cases decrease by 5, A case matches, Cases assign int , output after switch # 267 Switch.Case.Case value is not a constant expression > [,,,]{(){=;=;=;switch( * 5){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break; } << ;}} > Type: debug_output Hardness: 20 // --------------------------------------------------------------------------- // 300 // Switch.Body.No statement (has break) // 3 out of 6 cases with no statement but break - either evenly interspersed or back to back // Inc versus dec // print inSitu / update a variable and print at the end // Incrementing, inSitu printing, alternate even cases # 300 Switch.Body.No statement > [,]{(){=;switch(){ case : << - 1; break; case : break; case : << + 1; break; case : break; case : << ; break; case : break; default: << * 2; break; }}} > Type: debug_output Hardness: 30 // Incrementing, @end printing - variable update, back-to-back cases # 301 Switch.Body.No statement > [,]{(){=;=; switch(){ case : = + 1; break; case : = - 1; break; case : break; case : break; case : break; case : = + 10; break; default: = * 10; break; } << ; }} > Type: debug_output Hardness: 35 // Incrementing, @end printing - variable initialization, alternate odd cases # 302 Switch.Body.No statement > [,]{(){=;=0; switch(){ case : break; case : = ; break; case : break; case : = ; break; case : break; case : = ; break; default: = ; break; } << ; }} > Type: debug_output Hardness: 35 // Incrementing, inSitu printing, back-to-back cases # 303 Switch.Body.No statement > [,]{(){=; switch(){ case : break; case : break; case : break; case : << ; break; case : << + 1; break; case : << - 1; break; default: << + 10; break; } }} > Type: debug_output Hardness: 30 // Incrementing, @end printing - variable initialization- used to modify condition variable at the end, alternate even cases # 304 Switch.Body.No statement > [,]{(){=;=0; switch(){ case : = ; break; case : break; case : = ; break; case : break; case : = ; break; case : break; default: = - ; break; } = - ; << ; }} > Type: debug_output Hardness: 35 // Incrementing, @end printing - variable initialization- used to modify condition variable at the end, back-to-back # 305 Switch.Body.No statement > [,]{(){=;=0; switch(){ case : = ; break; case : break; case : break; case : break; case : = ; break; case : = 10; break; default: = ; break; } = + ; << ; }} > Type: debug_output Hardness: 30 // Decrementing, inSitu printing, alternate even cases # 310 Switch.Body.No statement > [,]{(){=;switch(){ case : break; case : << ; break; case : break; case : << ; break; case : break; case : << ; break; default: << ; break; }}} > Type: debug_output Hardness: 30 // Decrementing, @end printing - variable update, back-to-back cases # 311 Switch.Body.No statement > [,]{(){=;=; switch(){ case : = * 2; break; case : break; case : break; case : break; case : = / 2; break; case : = % 2; break; default: = + 2; break; } << ; }} > Type: debug_output Hardness: 35 // Decrementing, @end printing - variable initialization, alternate odd cases # 312 Switch.Body.No statement > [,]{(){=;=0; switch(){ case : = ; break; case : break; case : = ; break; case : break; case : = ; break; case : break; default: = ; break; } << ; }} > Type: debug_output Hardness: 35 // Decrementing, inSitu printing, back-to-back cases # 313 Switch.Body.No statement > [,]{(){=; switch(){ case : << - 1; break; case : << ; break; case : << + 1; break; case : break; case : break; case : break; default: << ; break; } }} > Type: debug_output Hardness: 30 // Decrementing, @end printing - variable initialization- used to modify condition variable at the end, alternate even cases # 314 Switch.Body.No statement > [,]{(){=;=0; switch(){ case : break; case : = ; break; case : break; case : = ; break; case : break; case : = ; break; default: = - ; break; } = - ; << ; }} > Type: debug_output Hardness: 35 // Decrementing, @end printing - variable initialization- used to modify condition variable at the end, back to back # 315 Switch.Body.No statement > [,]{(){=;=0; switch(){ case : = ; break; case : = 10; break; case : break; case : break; case : break; case : = ; break; default: = ; break; } = + ; << ; }} > Type: debug_output Hardness: 30 // --------------------------------------------------------------------------- // DONE // Since these are errors for C#, problem type is debug_output // 325 // Switch.Body.No break.Has statements // Incrementing vs Decrementing // Printing Vs Adding to a variable // THE FOLLOWING TEMPLATES ARE DESIGNED FOR PRIMARY USE BY C#. THEY HAVE EXACTLY ONE CASE WITH NO BREAK, AND THE CONDITION EVALUATES TO THAT CASE. // THEREFORE, THE TEMPLATES WILL WORK FOR C++ AND JAVA. BUT, SINCE THEY HAVE ONLY ONE CASE WITH NO BREAK, THEY WILL ALSO WORK FOR C# - REQUIRING // USER TO IDENTIFY ONLY ONE ERROR INSTEAD OF SAY 5 OR 6 ERRORS CORRESPONDING TO THE 5 OR 6 CASES WITH NO BREAK // 5 random values for cases # 325 Switch.Body.No break.Has statements > {(){=;switch(){ case : << ; break; case : << ; break; case : << ; break; case : << ; case : << ; break; default: << ; break; }}} > Type: debug_output Hardness: 30 # 326 Switch.Body.No break.Has statements > {(){=;switch(){ case : << + 10; break; case : << + 20; case : << - 10; break; case : << 100 - ; break; case : << - 20; break; default: << + ; break; }}} > Type: debug_output Hardness: 30 # 327 Switch.Body.No break.Has statements > {(){=;=;switch(){ case : << / ; break; case : << * ; break; case : << * ; break; case : << % ; break; case : << - ; default: << + ; break; }}} > Type: debug_output Hardness: 30 # 328 Switch.Body.No break.Has statements > {(){=;=;switch(){ case : = / ; break; case : = * ; break; case : = + 10; case : = * 10; break; case : = - ; break; default: = % ; break; } << ;}} > Type: debug_output Hardness: 30 # 329 Switch.Body.No break.Has statements > {(){ = 10;switch(){ case 10: << / 10; case 8: << * 10; break; case 6: << + ; break; case 4: << % 2; break; case 2: << * ; break; default: << % 10; break; }}} > Type: debug_output Hardness: 30 # 330 Switch.Body.No break.Has statements > []{(){ = 15; = ;switch(){ case 25: << / 10; break; case 20: << - ; break; case 15: << ; case 10: << ; break; case 5: << + ; break; default: << * ; break; }}} > Type: debug_output Hardness: 30 # 331 Switch.Body.No break.Has statements > []{(){ = ; = ;switch(){ case : << * 10; break; case : << * 10; break; case : << ; break; case : << * 100; case : << * 100; break; default: << ; break; }}} > Type: debug_output Hardness: 30 # 332 Switch.Body.No break.Has statements > {(){ = 70; = 100;switch(){ case 90: = / 10; break; case 80: = - 30; break; case 70: = ; case 60: = + 20; break; case 50: = * 2; break; default: = * 10; break; } << ;}} > Type: debug_output Hardness: 30 # 333 Switch.Body.No break.Has statements > []{(){ = ; = ;switch(){ case : << + 1; break; case : << + 1; case : << - 1; break; case : << - 1; break; case : << ; break; default: << ; break; }}} > Type: debug_output Hardness: 30 // THESE TEMPLATES ARE PREFERABLE FOR C++ AND JAVA. FOR C#, THEY GENERATE MULTIPLE ERRORS // Incrementing # 335 Switch.Body.No break.Has statements > // {(){=;switch(){ case 1: << * 10; case 2: << * 10; case 3: << * 10; case 4: << * 10; case 5: << * 10; default: << * 10; }}} [,,]{(){=;switch(){ case : << ; case : << ; case : << ; case : << ; case 5: << ; default: << ; }}} > Type: debug_output Hardness: 30 # 336 Switch.Body.No break.Has statements > // {(){=;switch(){ case 1: << ; break; case 2: << ; case 3: << ; case 4: << ; case 5: << ; break; default: << ; break; }}} [,]{(){=;switch(){ case : << - 2; break; case : << - 1; case : << ; case : << + 1; case : << + 2; break; default: << ; break; }}} > Type: debug_output Hardness: 35 # 337 Switch.Body.No break.Has statements > {(){=;=;switch(){ case 1: = - 1; case 2: = - 1; case 3: = - 1; case 4: = - 1; case 5: = - 1; default: = - 1; } << ; }} > Type: debug_output Hardness: 30 # 338 Switch.Body.No break.Has statements > {(){=;=;switch(){ case 1: = + 1; break; case 2: = + 1; case 3: = + 1; case 4: = + 1; case 5: = + 1; break; default: = + 1; break; } << ;}} > Type: debug_output Hardness: 35 # 339 Switch.Body.No break.Has statements > // {(){= * 10;=1;switch(){ case 10: = * 2; case 20: = * 2; case 30: = * 2; case 40: = * 2; case 50: = * 2; default: << ; } << ; }} []{(){=;=1;switch(){ case 10: = * 2; case 20: = * 2; case 30: = * 2; case 40: = * 2; case 50: = * 2; default: << ; } << ; }} > Type: debug_output Hardness: 35 # 340 Switch.Body.No break.Has statements > // {(){= * 10;=0;switch(){ case 10: = + 10; break; case 20: = + 10; case 30: = + 10; case 40: = + 10; case 50: = + 10; break; default: << ; break; } << ;}} [,]{(){=;=;switch(){ case 10: = + 10; break; case 20: = + 10; case 30: = + 10; case 40: = + 10; case 50: = + 10; break; default: << ; break; } << ;}} > Type: debug_output Hardness: 35 // Decrementing # 344 Switch.Body.No break.Has statements > // {(){=;switch(){ case 5: << * 10; case 4: << * 10; case 3: << * 10; case 2: << * 10; case 1: << * 10; default: << * 10; }}} [,,,,,]{(){=;switch(){ case 5: << ; case 4: << ; case 3: << ; case 2: << ; case 1: << ; default: << ; }}} > Type: debug_output Hardness: 30 # 345 Switch.Body.No break.Has statements > {(){=;switch(){ case 5: << + 10; break; case 4: << + 1; case 3: << ; case 2: << - 1; case 1: << * 10; break; default: << ; break; }}} > Type: debug_output Hardness: 35 # 346 Switch.Body.No break.Has statements > {(){=;=0;switch(){ case 5: = + 2; case 4: = + 2; case 3: = + 2; case 2: = + 2; case 1: = + 2; default: = + 2; } << ; }} > Type: debug_output Hardness: 30 # 347 Switch.Body.No break.Has statements > // {(){=;=10;switch(){ case 5: = - 2; break; case 4: = - 2; case 3: = - 2; case 2: = - 2; case 1: = - 2; break; default: = - 2; break; } << ;}} [,,]{(){=;=;switch(){ case 5: = - 2; break; case 4: = - 2; case 3: = - 2; case 2: = - 2; case 1: = - 2; break; default: = - 2; break; } << ;}} > Type: debug_output Hardness: 35 # 348 Switch.Body.No break.Has statements > // {(){= * 10;=16;switch(){ case 50: = / 2; case 40: = / 2; case 30: = / 2; case 20: = / 2; case 10: = / 2; default: << ; } << ; }} [,]{(){=;=;switch(){ case 50: = / 2; case 40: = / 2; case 30: = / 2; case 20: = / 2; case 10: = / 2; default: << ; } << ; }} > Type: debug_output Hardness: 35 # 349 Switch.Body.No break.Has statements > // {(){= * 10;=50;switch(){ case 50: = - 10; break; case 40: = - 10; case 30: = - 10; case 20: = - 10; case 10: = - 10; break; default: << ; break; } << ;}} [,]{(){=;=;switch(){ case 50: = - 10; break; case 40: = - 10; case 30: = - 10; case 20: = - 10; case 10: = - 10; break; default: << ; break; } << ;}} > Type: debug_output Hardness: 35 // --------------------------------------------------------------------------- // 350 // Switch.Body.No break.No statement // DONE // Incrementing # 350 Switch.Body.No break.No statement > // {(){= * 10; = + ;switch(){ case 16: case 17: case 18: case 19: case 20: << ; break; case 26: case 27: case 28: case 29: case 30: << ; break; case 36: case 37: case 38: case 39: case 40: << ; break; default: << ; break; }}} [,]{(){=;switch(){ case 16: case 17: case 18: case 19: case 20: << ; break; case 26: case 27: case 28: case 29: case 30: << ; break; case 36: case 37: case 38: case 39: case 40: << ; break; default: << ; break; }}} > Type: debug_output Hardness: 30 # 351 Switch.Body.No break.No statement > // {(){= * 10; = + ;switch(){ case 41: case 42: case 43: case 44: case 45: << / 10; break; case 51: case 52: case 53: case 54: case 55: << * 10; break; case 61: case 62: case 63: case 64: case 65: << + ; break; default: << - ; break; }}} [,]{(){=; = ;switch(){ case 41: case 42: case 43: case 44: case 45: << / 10; break; case 51: case 52: case 53: case 54: case 55: << * 10; break; case 61: case 62: case 63: case 64: case 65: << + ; break; default: << - ; break; }}} > Type: debug_output Hardness: 30 # 352 Switch.Body.No break.No statement > // {(){= * 10; = + ;=;switch(){ case 11: case 12: case 13: case 14: case 15: = + 10; break; case 21: case 22: case 23: case 24: case 25: = * 10; break; case 31: case 32: case 33: case 34: case 35: = + 1; break; default: = * 2; break; } << ; }} [,]{(){=;=;switch(){ case 11: case 12: case 13: case 14: case 15: = + 10; break; case 21: case 22: case 23: case 24: case 25: = * 10; break; case 31: case 32: case 33: case 34: case 35: = + 1; break; default: = * 2; break; } << ; }} > Type: debug_output Hardness: 30 # 353 Switch.Body.No break.No statement > // {(){= * 10; = + ;;switch(){ case 74: case 75: case 76: case 77: case 78: = ; break; case 84: case 85: case 86: case 87: case 88: = * 10; break; case 94: case 95: case 96: case 97: case 98: = * 10; break; default: = * 10; break; } << ;}} [,,,]{(){= ; = ;;switch(){ case 74: case 75: case 76: case 77: case 78: = ; break; case 84: case 85: case 86: case 87: case 88: = * 10; break; case 94: case 95: case 96: case 97: case 98: = ; break; default: = ; break; } << ;}} > Type: debug_output Hardness: 30 # 354 Switch.Body.No break.No statement > // {(){= * 2; = * 10; = + ;switch(){ case 42: case 44: case 46: case 48: case 50: << ; break; case 52: case 54: case 56: case 58: case 60: << ; break; case 62: case 64: case 66: case 68: case 70: << + ; break; default: << ; break; }}} [,]{(){= ; = ; = + ;switch(){ case 42: case 44: case 46: case 48: case 50: << ; break; case 52: case 54: case 56: case 58: case 60: << ; break; case 62: case 64: case 66: case 68: case 70: << ; break; default: << ; break; }}} > Type: debug_output Hardness: 30 # 355 Switch.Body.No break.No statement > // {(){= * 10; = * 100; = + ;;switch(){ case 150: case 160: case 170: case 180: case 190: = * 100; break; case 250: case 260: case 270: case 280: case 290: = ; break; case 350: case 360: case 370: case 380: case 390: = * 10; break; default: = ; break; } << ;}} [,,]{(){= ; = ; = + ;;switch(){ case 150: case 160: case 170: case 180: case 190: = ; break; case 250: case 260: case 270: case 280: case 290: = ; break; case 350: case 360: case 370: case 380: case 390: = ; break; default: = ; break; } << ;}} > Type: debug_output Hardness: 30 // Decrementing # 360 Switch.Body.No break.No statement > [,]{(){= ;switch(){ case 69: case 68: case 67: case 66: case 65: << ; break; case 59: case 58: case 57: case 56: case 55: << ; break; case 49: case 48: case 47: case 46: case 45: << ; break; default: << ; break; }}} > Type: debug_output Hardness: 30 # 361 Switch.Body.No break.No statement > // []{(){=; = + ;switch(){ case 95: case 94: case 93: case 92: case 91: << + 10; break; case 85: case 84: case 83: case 82: case 81: << + 10; break; case 75: case 74: case 73: case 72: case 71: << - 10; break; default: << - 10; break; }}} [,,,]{(){=; = ;switch(){ case 95: case 94: case 93: case 92: case 91: << + 10; break; case 85: case 84: case 83: case 82: case 81: << + 10; break; case 75: case 74: case 73: case 72: case 71: << - 10; break; default: << - 10; break; }}} > Type: debug_output Hardness: 30 # 362 Switch.Body.No break.No statement > [,]{(){= ;=;switch(){ case 38: case 37: case 36: case 35: case 34: = * 10; break; case 28: case 27: case 26: case 25: case 24: = + 10; break; case 18: case 17: case 16: case 15: case 14: = + 2; break; default: = - 2; break; } << ; }} > Type: debug_output Hardness: 30 # 363 Switch.Body.No break.No statement > [,,,]{(){=;;switch(){ case 99: case 98: case 97: case 96: case 95: = ; break; case 89: case 88: case 87: case 86: case 85: = ; break; case 79: case 78: case 77: case 76: case 75: = ; break; default: = ; break; } << ;}} > Type: debug_output Hardness: 30 # 364 Switch.Body.No break.No statement > // [,]{(){= ; = ; = + ;switch(){ case 98: case 96: case 94: case 92: case 90: << ; break; case 88: case 86: case 84: case 82: case 80: << ; break; case 78: case 76: case 74: case 72: case 70: << - ; break; default: << ; break; }}} [,,,,]{(){= ; = ; = ;switch(){ case 98: case 96: case 94: case 92: case 90: << ; break; case 88: case 86: case 84: case 82: case 80: << ; break; case 78: case 76: case 74: case 72: case 70: << - ; break; default: << ; break; }}} > Type: debug_output Hardness: 30 # 365 Switch.Body.No break.No statement > // [,]{(){=; = ; = + ;;switch(){ case 650: case 640: case 630: case 620: case 610: = * 100; break; case 550: case 540: case 530: case 520: case 510: = ; break; case 450: case 440: case 430: case 420: case 410: = * 100; break; default: = 1000; break; } << ;}} [,,,,]{(){=; = ; = ;;switch(){ case 650: case 640: case 630: case 620: case 610: = * 100; break; case 550: case 540: case 530: case 520: case 510: = ; break; case 450: case 440: case 430: case 420: case 410: = * 100; break; default: = 1000; break; } << ;}} > Type: debug_output Hardness: 30 // --------------------------------------------------------------------------- // 400 // Switch.Nested // Considered incrementing versus decrementing // Printing in-situ versus printing at the end of the nested switch versus printing at the end of the nesting switch (much harder, must ensure uniqueness of all 9 cases) // inc-inc/in-situ/var - 400 // /end-of-nested/var - 401 // /in-situ/expr - 402 // /@ end/expr - 403 // /in-situ/expr - 404 // /end-of-nested/expr with multiples of 100 - 405 // Incrementing # 400 Switch.Nested > {(){=;=;=;switch(){ case 1: switch(){ case 4: << ; break; case 5: << ; break; case 6: << ; break; default: << ; << ; break; } break; case 2: switch(){ case 7: << ; break; case 8: << ; break; case 9: << ; break; default: << ; << ; break; } break; case 3: switch(){ case 4: << ; break; case 5: << ; break; case 6: << ; break; default: << ; << ; break; } break; default: << ; << ; << ; break; }}} > Type: output Hardness: 50 # 401 Switch.Nested > {(){=;=;=;;switch(){ case 4: switch(){ case 1: = ; break; case 2: = ; break; case 3: = ; break; default: = ; break; } << ; break; case 5: switch(){ case 7: = ; break; case 8: = ; break; case 9: = ; break; default: = ; break; } << ; break; case 6: switch(){ case 1: = ; break; case 2: = ; break; case 3: = ; break; default: = ; break; } << ; break; default: << ; << ; << ; break; }}} > Type: output Hardness: 50 # 402 Switch.Nested > {(){=;=;=;switch(){ case 1: switch(){ case 4: << + ; break; case 5: << + ; break; case 6: << + ; break; default: << ; << ; break; } break; case 2: switch(){ case 4: << - ; break; case 5: << - ; break; case 6: << - ; break; default: << ; << ; break; } break; case 3: switch(){ case 7: << - ; break; case 8: << - ; break; case 9: << - ; break; default: << ; << ; break; } break; default: << ; << ; << ; break; }}} > Type: output Hardness: 50 # 403 Switch.Nested > []{(){=;;;switch(){ case 70: = ; switch(){ case 1: = * 10; break; case 2: = + 10; break; case 3: = ; break; default: = ; break; } break; case 80: = ; switch(){ case 7: = + 10; break; case 8: = ; break; case 9: = * 10; break; default: = ; break; } break; case 90: = ; switch(){ case 4: = ; break; case 5: = * 10; break; case 6: = + 10; break; default: = ; break; } break; default: = ; break; } << ; }} > Type: output Hardness: 50 # 404 Switch.Nested > []{(){=;;switch(){ case 10: = ; switch(){ case 1: << + ; break; case 2: << / ; break; case 3: << - ; break; default: << * 10; break; } break; case 20: = ; switch(){ case 4: << / ; break; case 5: << + ; break; case 6: << - ; break; default: << ; << ; break; } break; case 30: = ; switch(){ case 7: << ; break; case 8: << + ; break; case 9: << - ; break; default: << ; << ; break; } break; default: << ; << * 10; break; }}} > Type: output Hardness: 50 # 405 Switch.Nested > [,,,]{(){=;;;switch(){ case 400: = ; switch(){ case 70: = / 10; break; case 80: = ; break; case 90: = / 10; break; default: = ; break; } << ; break; case 500: = ; switch(){ case 40: = / 10; break; case 50: = / ; break; case 60: = / 10; break; default: = ; break; } << ; break; case 600: = ; switch(){ case 10: = / 10; break; case 20: = / ; break; case 30: = / 10; break; default: = ; break; } << ; break; default: << ; << ; break; }}} > Type: output Hardness: 50 // Decrementing # 410 Switch.Nested > {(){=;=;=;switch(){ case 6: switch(){ case 3: << ; break; case 2: << ; break; case 1: << ; break; default: << ; << ; break; } break; case 5: switch(){ case 9: << ; break; case 8: << ; break; case 7: << ; break; default: << ; << ; break; } break; case 4: switch(){ case 3: << ; break; case 2: << ; break; case 1: << ; break; default: << ; << ; break; } break; default: << ; << ; << ; break; }}} > Type: output Hardness: 50 # 411 Switch.Nested > {(){=;=;=;;switch(){ case 9: switch(){ case 3: = ; break; case 2: = ; break; case 1: = ; break; default: = ; break; } << ; break; case 8: switch(){ case 6: = ; break; case 5: = ; break; case 4: = ; break; default: = ; break; } << ; break; case 7: switch(){ case 6: = ; break; case 5: = ; break; case 4: = ; break; default: = ; break; } << ; break; default: << ; << ; << ; break; }}} > Type: output Hardness: 50 # 412 Switch.Nested > {(){=;=;=;switch(){ case 9: switch(){ case 6: << / 3; break; case 5: << - ; break; case 4: << / 2; break; default: << ; << ; break; } break; case 8: switch(){ case 6: << / 4; break; case 5: << - ; break; case 4: << / 2; break; default: << ; << ; break; } break; case 7: switch(){ case 3: << + ; break; case 2: << * ; break; case 1: << - ; break; default: << ; << ; break; } break; default: << ; << ; << ; break; }}} > Type: output Hardness: 50 # 413 Switch.Nested > []{(){=;;;switch(){ case 90: = ; switch(){ case 6: = + 10; break; case 5: = * 10; break; case 4: = ; break; default: = ; break; } break; case 80: = ; switch(){ case 9: = ; break; case 8: = + 10; break; case 7: = * 10; break; default: = ; break; } break; case 70: = ; switch(){ case 3: = * 10; break; case 2: = ; break; case 1: = + 10; break; default: = ; break; } break; default: = ; break; } << ; }} > Type: output Hardness: 50 # 414 Switch.Nested > []{(){=;;switch(){ case 30: = ; switch(){ case 9: << / 10; break; case 8: << / 2; break; case 7: << ; break; default: << * 10; break; } break; case 20: = ; switch(){ case 6: << / 2; break; case 5: << + ; break; case 4: << / 10; break; default: << * 10; break; } break; case 10: = ; switch(){ case 3: << - ; break; case 2: << / ; break; case 1: << + ; break; default: << * 10; break; } break; default: << ; << ; break; }}} > Type: output Hardness: 50 # 415 Switch.Nested > [,,,]{(){=;;;switch(){ case 600: = ; switch(){ case 30: = / 100; break; case 20: = / 10; break; case 10: = / ; break; default: = ; break; } << ; break; case 500: = ; switch(){ case 60: = / 10; break; case 50: = / ; break; case 40: = / 10; break; default: = ; break; } << ; break; case 400: = ; switch(){ case 90: = / 10; break; case 80: = + ; break; case 70: = / 10; break; default: = ; break; } << ; break; default: << ; << ; break; }}} > Type: output Hardness: 50 // --------------------------------------------------------------------------- // Multiple switches // Incrementing versus decrementing: ii, id, di, dd // independent versus dependent: pp, vp, vv (after each switch versus at the end, one variable versus two) // assign to variable in first, use it as condition of second to print // assign to variable in first, use it as condition of second to assign to another variable and print it after second switch // Modify value of same variable in both switch statements, and print after second switch // inc-inc, inc-dec, dec-inc, dec-dec // // inc-inc, @end-@end (m + n and m - n) # 500 Switch.Multiple > [,]{(){=; = ;;switch(){ case : = ; break; case : = ; break; case : = + 1; break; case : = - 1; break; case : = ; break; default: = ; break;} << ; switch(){ case : = + 10; break; case : = + 1; break; case : = - 1; break; case : = * 10; break; case : = - 10; break; default: = 0; break;} << ; }} > Type: output Hardness: 40 // inc-dec, inSitu-@end (m + 2n and m - 2n) # 501 Switch.Multiple > [,]{(){=; = ;switch(){ case : << ; break; case : << ; break; case : << + 2; break; case : << - 2; break; case : << ; break; default: << ; break;} ; switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break;} << ; }} > Type: output Hardness: 40 // dec-inc, @end-inSitu (m - 2n, and its multiples of 10) # 502 Switch.Multiple > [,]{(){=; = ;;switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = 0; break;} << ; switch(){ case : << ; break; case : << + 1; break; case : << - 1; break; case : << + 2; break; case : << - 2; break; default: << * 2; break;} }} > Type: output Hardness: 40 // dec-dec, inSitu-inSitu (Multiples of 100 and 10) # 503 Switch.Multiple > [,]{(){=; = ;switch(){ case 1000: << ; break; case 900: << ; break; case 800: << / 100; break; case 700: << / 10; break; case 600: << / 10; break; default: << ; << ; break;} switch(){ case 50: << + 10; break; case 40: << - 10; break; case 30: << * 10; break; case 20: << + ; break; case 10: << / ; break; default: << ; << ; break;} }} > Type: output Hardness: 40 // inc-inc, inSitu-@end (Multiples of 3 and 2) # 504 Switch.Multiple > // [,,]{(){=; = ;switch(){ case : << * 10; break; case : << * 10; break; case : << + 10; break; case : << + 10; break; case : << + 100; break; default: << + 100; break;} ; switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break;} << ; }} [,,]{(){=; = ; =;switch(){ case : << * 10; break; case : << * 10; break; case : << + 10; break; case : << + 10; break; case : << + 100; break; default: << + 100; break;} switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break;} << ; }} > Type: output Hardness: 40 // inc-dec, @end-@end (multiples of 5 and 10) # 505 Switch.Multiple > [,,]{(){=; = ;;switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = * 10; break;} << ; switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = * 5; break;} << ; }} > Type: output Hardness: 40 // dec-inc, inSitu-inSitu (odd, even) # 506 Switch.Multiple > [,,]{(){=; = ; switch(){ case : << - 1; break; case : << + 1; break; case : << ; break; case : << - 1; break; case : << + 1; break; default: << ; break;} switch(){ case : << + 2; break; case : << - 2; break; case : << ; break; case : << + 2; break; case : << - 2; break; default: << ; break;} }} > Type: output Hardness: 40 // dec-dec, @end-inSitu (10m + 10n, 10m - 10n) # 507 Switch.Multiple > [,]{(){=; = ; ; switch(){ case : = / 10; break; case : = * 10; break; case : = - 10; break; case : = + 10; break; case : = + 100; break; default: = ; break;} << ; switch(){ case : << ; break; case : << ; break; case : << ; break; case : << ; break; case : << ; break; default: << * 10; break;} }} > Type: output Hardness: 40 // Dependent switches // [,]{(){=;;switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break;} << ; ; switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break;} << ; }} // [,]{(){=;;switch(){ case : = ; break; case : = ; break; case : = ; break; case : = ; break; case : = ; break; default: = ; break;} << ; switch(){ case : << ; break; case : << ; break; case : << ; break; case : << ; break; case : << ; break; default: << ; break;} }} // // FOLLOWING DOES NOT WORK IF VALUE OF CONDITION IS 2 OR GREATER - BUG TO BE FIXED - // // BLOCK INSIDE A STATEMENTSEQUENCE SEEMS TO GENERATE A PROBLEM // # 600 // Switch.Condition.Matches case // > // // {(){=;switch(){ case 1: << ; break; case 2: << ; break; case 3: << ; break; case 4: << ; break; case 5: << ; break; default: << ; break; }}} // {(){=2;switch(){ case 1: {<< ; break;} case 2: {<< ;} break; case 3: {<< ;} << ; break; case 4: {<< ;} << ; {<< ;} break; case 5: << ; break; default: << ; break; }}} // > // Type: debug_output // Hardness: 20 // -------------------------------------------------------------------------- // 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: debug_output Hardness: 10 // Semantic error # 91 Demonstration > {(){;<<;}} > Type: debug_output Hardness: 10 // How to enter NO output # 92 Demonstration > {(){=;=;; = + ;}} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------