// ------------------------------------------------------------------------- // Arithmetic Operators - 1 operator - ALL DONE // ---------- // Correctness // Addition, Multiplication // integers // real // mixed-mode: integers & reals // Subtraction // integers // small - large, large - small, equal // real // small - large, large - small, equal // mixed-mode: integers & reals // Division // integers // large / small, small / large, // real numbers // large / small, small / large, // mixed-mode: integers & reals // Modulus // integers // large op small, small op large, equal op equal // real - error # 101 Operator.Arithmetic.+.Correct > 4 + 5 > Type: expression Hardness: 10 # 102 Operator.Arithmetic.*.Correct > 3 * 4 > Type: expression Hardness: 10 # 103 Operator.Arithmetic.+.Correct > 2.5 + 1.5 > Type: expression Hardness: 10 # 104 Operator.Arithmetic.*.Correct > 2.5 * 2.0 > Type: expression Hardness: 10 # 105 Operator.Arithmetic.+.Correct ? Operator.Arithmetic.+.Coercion > 3 + 5.5 > Type: expression Hardness: 20 # 106 Operator.Arithmetic.*.Correct ? Operator.Arithmetic.*.Coercion > 3.5 * 2 > Type: expression Hardness: 20 # 107 Operator.Arithmetic.-.Correct > 4 - 7 > Type: expression Hardness: 10 # 108 Operator.Arithmetic.-.Correct > 8 - 5 > Type: expression Hardness: 10 # 109 Operator.Arithmetic.-.Correct > 6 - 6 > Type: expression Hardness: 10 # 110 Operator.Arithmetic.-.Correct > 5.5 - 3.0 > Type: expression Hardness: 10 # 111 Operator.Arithmetic.-.Correct > 2.0 - 4.5 > Type: expression Hardness: 10 # 112 Operator.Arithmetic.-.Correct > 4.0 - 4.0 > Type: expression Hardness: 10 # 113 Operator.Arithmetic.-.Correct ? Operator.Arithmetic.-.Coercion > 7 - 3.5 > Type: expression Hardness: 20 # 114 Operator.Arithmetic.-.Correct ? Operator.Arithmetic.-.Coercion > 4 - 6.5 > Type: expression Hardness: 20 # 115 Operator.Arithmetic.-.Correct ? Operator.Arithmetic.-.Coercion > 8 - 8.0 > Type: expression Hardness: 20 # 116 Operator.Arithmetic./.Integer.Correct > 7 / 4 > Type: expression Hardness: 20 # 117 Operator.Arithmetic./.Integer.Correct > 3 / 6 > Type: expression Hardness: 20 # 118 Operator.Arithmetic./.Real.Correct > 6.0 / 4.0 > Type: expression Hardness: 20 # 119 Operator.Arithmetic./.Real.Correct > 4.0 / 8.0 > Type: expression Hardness: 20 # 120 Operator.Arithmetic./.Real.Correct ? Operator.Arithmetic./.Coercion > 6.0 / 4 > Type: expression Hardness: 20 # 121 Operator.Arithmetic./.Real.Correct ? Operator.Arithmetic./.Coercion > 2.0 / 4 > Type: expression Hardness: 20 # 122 Operator.Arithmetic.%.Correct > 7 % 4 > Type: expression Hardness: 20 # 123 Operator.Arithmetic.%.Correct > 4 % 7 > Type: expression Hardness: 20 # 124 Operator.Arithmetic.%.Correct > 6 % 6 > Type: expression Hardness: 20 # 125 Operator.Arithmetic.%."Incorrect operand type for modulus (%) operator" > 5.0 % 2 > Type: expression Hardness: 30 // ------------------------------------------------------------------------- // Precedence - Two Operators only - ALL DONE // + *, + / (both int and real), + % // - *, - / (both int and real), - % // Error for modulus # 201 Operator.Arithmetic.{+.{Correct,Precedence},*.{Correct,Precedence}} > 3 + 4 * 5 > Type: expression Hardness: 30 # 202 Operator.Arithmetic.{+.{Correct,Precedence},*.{Correct,Precedence}} > 4.0 + 6 * 3 > Type: expression Hardness: 40 # 203 Operator.Arithmetic.{+.{Correct,Precedence},/.{Integer.Correct,Precedence}} > 6 + 7 / 3 > Type: expression Hardness: 30 # 204 Operator.Arithmetic.{+.{Correct,Precedence,Coercion},/.{Real.Correct,Precedence}} > 5 + 7.0 / 4.0 > Type: expression Hardness: 40 # 205 Operator.Arithmetic.{+.{Correct,Precedence,Coercion},/.{Real.Correct,Precedence,Coercion}} > 4 + 4.0 / 8 > Type: expression Hardness: 40 # 206 Operator.Arithmetic.{+.{Correct,Precedence,Coercion},/.{Integer.Correct,Precedence}} > 3.5 + 7 / 4 > Type: expression Hardness: 40 # 207 Operator.Arithmetic.{+.{Correct,Precedence},%.{Correct,Precedence}} > 3 + 7 % 4 > Type: expression Hardness: 30 # 208 Operator.Arithmetic.{+.{Correct,Precedence,Coercion},%.{Correct,Precedence}} > 4.0 + 3 % 8 > Type: expression Hardness: 40 # 209 Operator.Arithmetic.{-.{Correct,Precedence},*.{Correct,Precedence}} > 8 - 2 * 5 > Type: expression Hardness: 30 # 210 Operator.Arithmetic.{-.{Correct,Precedence,Coercion},*.{Correct,Precedence,Coercion}} > 7 - 1.5 * 2 > Type: expression Hardness: 40 # 211 Operator.Arithmetic.{-.{Correct,Precedence},/.{Integer.Correct,Precedence}} > 7 - 4 / 3 > Type: expression Hardness: 30 # 212 Operator.Arithmetic.{-.{Correct,Precedence,Coercion},/.{Real.Correct,Precedence,Coercion}} > 9 - 6 / 4.0 > Type: expression Hardness: 40 # 213 Operator.Arithmetic.{-.{Correct,Precedence,Coercion},/.{Real.Correct,Precedence}} > 7 - 2.0 / 8.0 > Type: expression Hardness: 40 # 214 Operator.Arithmetic.{-.{Correct,Precedence,Coercion},/.{Integer.Correct,Precedence}} > 8.5 - 4 / 6 > Type: expression Hardness: 40 # 215 Operator.Arithmetic.{-.{Correct,Precedence},%.{Correct,Precedence}} > 9 - 4 % 6 > Type: expression Hardness: 30 # 216 Operator.Arithmetic.{-.{Correct,Precedence,Coercion},%.{Correct,Precedence}} > 8.5 - 8 % 3 > Type: expression Hardness: 40 # 217 Operator.Arithmetic.%."Incorrect operand type for modulus (%) operator" ? Operator.Arithmetic.{%.Precedence,+.Precedence} > 5 + 6.0 % 6 > Type: expression Hardness: 30 # 218 Operator.Arithmetic.%."Incorrect operand type for modulus (%) operator" ? Operator.Arithmetic.{%.Precedence,+.Precedence} > 8 + 4 % 8.0 > Type: expression Hardness: 30 # 219 Operator.Arithmetic.%."Incorrect operand type for modulus (%) operator" ? Operator.Arithmetic.{%.Precedence,-.Precedence} > 9 - 4 % 4.0 > Type: expression Hardness: 30 # 220 Operator.Arithmetic.%."Incorrect operand type for modulus (%) operator" ? Operator.Arithmetic.{%.Precedence,-.Precedence} > 7 - 9.0 % 2 > Type: expression Hardness: 30 // ------------------------------------------------------------------------- // Associativity - 2 operators- ALL DONE // + + + // - - - // * * * // / / / // % % % # 301 Operator.Arithmetic.+.{Correct,Associativity} > 3 + 4 + 5 > Type: expression Hardness: 50 # 302 Operator.Arithmetic.+.{Correct,Associativity,Coercion} > 2 + 5 + 3.0 > Type: expression Hardness: 50 # 303 Operator.Arithmetic.-.{Correct,Associativity,Coercion} > 9 - 5 - 2.0 > Type: expression Hardness: 50 # 304 Operator.Arithmetic.-.{Correct,Associativity,Coercion} > 11 - 3.0 - 6 > Type: expression Hardness: 50 # 305 Operator.Arithmetic.*.{Correct,Associativity,Coercion} > 2 * 3 * 1.5 > Type: expression Hardness: 50 # 306 Operator.Arithmetic.*.{Correct,Associativity,Coercion} > 4 * 1.5 * 2 > Type: expression Hardness: 50 # 307 Operator.Arithmetic./.{Integer.Correct,Associativity} > 12 / 2 / 2 > Type: expression Hardness: 50 # 308 Operator.Arithmetic./.{Integer.Correct,Associativity} > 16 / 8 / 4 > Type: expression Hardness: 50 # 309 Operator.Arithmetic./.{Real.Correct,Associativity,Coercion} > 10 / 2.5 / 2 > Type: expression Hardness: 50 # 310 Operator.Arithmetic./.{Real.Correct,Associativity,Coercion} ? Operator.Arithmetic./.Integer.Correct > 9 / 3 / 2.0 > Type: expression Hardness: 50 # 311 Operator.Arithmetic.%.{Correct,Associativity} > 9 % 5 % 2 > Type: expression Hardness: 50 # 312 Operator.Arithmetic.%.{Correct,Associativity} > 10 % 6 % 3 > Type: expression Hardness: 50 # 313 Operator.Arithmetic.%."Incorrect operand type for modulus (%) operator" ? Operator.Arithmetic.%.Associativity > 10 % 4 % 3.0 > Type: expression Hardness: 50 # 314 Operator.Arithmetic.%."Incorrect operand type for modulus (%) operator" > 15 % 6.0 % 2 > Type: expression Hardness: 50 # 315 Operator.Arithmetic.%."Incorrect operand type for modulus (%) operator" > 15.0 % 2.5 % 4 > Type: expression Hardness: 50 // ------------------------------------------------------------------------- // Precedence & Associativity - 3 Operators - ALL DONE // + + * (int), + * + (real) // * + * // + + / (int), + / + (real) // / + / // + + % (int), + % + // % + % // - - * (int), - * - (real) // * - * // - - / (int), - / - (real) // / - / // - - % (int), - % - // % - % // % with errors // / + %, / - % // / + *, / - * // * + %, * - % // Divide by Zero errors # 401 Operator.Arithmetic.{+.{Correct,Precedence},*.{Correct,Precedence}} ? Operator.Arithmetic.+.Associativity > -8 + 5 + 2 * 3 > Type: expression Hardness: # 402 Operator.Arithmetic.{+.{Correct,Precedence,Coercion},*.{Correct,Precedence,Coercion}} ? Operator.Arithmetic.+.Associativity > 0.5 + 4 * 2.5 + 2 > Type: expression Hardness: # 403 Operator.Arithmetic. > 2 * 4 + 2 * 1.5 > Type: expression Hardness: # 404 Operator.Arithmetic. > -6 + 4 + 8 / 5 > Type: expression Hardness: # 405 Operator.Arithmetic. > 3 + 4.5 + 8 / 3 > Type: expression Hardness: # 406 Operator.Arithmetic. > 3 + 6 / 4.0 + 0.8 > Type: expression Hardness: # 407 Operator.Arithmetic. > 10 / 4 + 10.0 / 4.0 > Type: expression Hardness: # 408 Operator.Arithmetic. > -8 + 3 + 7 % 4 > Type: expression Hardness: # 409 Operator.Arithmetic. > 3 + 15 % 7 + 5 > Type: expression Hardness: # 410 Operator.Arithmetic. > 10 % 3 + 3 % 10 > Type: expression Hardness: # 411 Operator.Arithmetic. > 6 + 2 + 8.0 % 4.0 > Type: expression Hardness: # 412 Operator.Arithmetic. > 4 + 10 % 10.0 + 4 > Type: expression Hardness: # 413 Operator.Arithmetic. > 12 % 5 + 5 % 12.0 > Type: expression Hardness: # 414 Operator.Arithmetic. > 2 - 4 - 2 * 4 > Type: expression Hardness: # 415 Operator.Arithmetic. > 4.5 - 4 * 2 - 2.5 > Type: expression Hardness: # 416 Operator.Arithmetic. > 2.5 * 4 - 4.5 * 2 > Type: expression Hardness: # 417 Operator.Arithmetic. > 9 - 5 - 9 / 5 > Type: expression Hardness: # 418 Operator.Arithmetic. > 4 - 3 / 1.5 - 3.5 > Type: expression Hardness: # 419 Operator.Arithmetic. > 4 / 9 - 9 / 4 > Type: expression Hardness: # 420 Operator.Arithmetic. > 8 / 5 - 8 / 5.0 > Type: expression Hardness: # 421 Operator.Arithmetic. > 15.0 / 6.0 - 15 / 6 > Type: expression Hardness: # 422 Operator.Arithmetic. > 2 - 6 - 2 % 6 > Type: expression Hardness: # 423 Operator.Arithmetic. > 7 - 7 % 4 - 4 > Type: expression Hardness: # 424 Operator.Arithmetic. > 9 % 5 - 5 % 9 > Type: expression Hardness: # 425 Operator.Arithmetic. > 10 - 4 - 10 % 4.0 > Type: expression Hardness: # 426 Operator.Arithmetic. > 8 - 5 % 2.5 - 3 > Type: expression Hardness: # 427 Operator.Arithmetic. > 8 % 5 - 5 % 8.0 > Type: expression Hardness: # 428 Operator.Arithmetic. > 3 / 6 + 3 % 6 > Type: expression Hardness: # 429 Operator.Arithmetic. > 8 / 5 - 8 % 5 > Type: expression Hardness: # 430 Operator.Arithmetic. > 6 % 6 - 6 / 6 > Type: expression Hardness: # 431 Operator.Arithmetic. > 10 / 4.0 - 10 % 4 > Type: expression Hardness: # 432 Operator.Arithmetic. > 9 / 5.0 - 9 % 5.0 > Type: expression Hardness: # 433 Operator.Arithmetic. > 5 / 3 + 3 * 5 > Type: expression Hardness: # 434 Operator.Arithmetic. > 10 / 2.5 - 4 * 2.5 > Type: expression Hardness: # 435 Operator.Arithmetic. > 5 / 5 + 5 * 5 > Type: expression Hardness: # 436 Operator.Arithmetic. > 3 * 3 + 3 % 3 > Type: expression Hardness: # 437 Operator.Arithmetic. > 7 % 7 - 7 * 7 > Type: expression Hardness: # 438 Operator.Arithmetic. > 5 * 0 - 15 % 5 > Type: expression Hardness: # 439 Operator.Arithmetic. > 2 * 3 + 4 % 0.5 > Type: expression Hardness: # 440 Operator.Arithmetic. > 7 / 3 - 5 / 0 > Type: expression Hardness: # 441 Operator.Arithmetic. > 8 - 6 - 4 % 0 > Type: expression Hardness: // ------------------------------------------------------------------------- // Associativity - 3 operators // + - + and - + - // * / * - both int and real // / * / - both int and real // * % * and % * % // / % / and % / % <<< CONTINUE HERE // * / %, * % /, / * %, / % *, % * /, % / * 3 + 4 - 2 + 5 2 + 5 - 3 + 6.0 9 - 5 + 7 - 4 8 - 3 + 4.0 - 6 5 * 2 / 4 * 3 3 * 3 / 5 * 1.5 2 * 5 / 4.0 * 2 3 * 4.0 / 5 * 4 7 / 3 * 3 / 7 3 / 6 * 6.0 / 3 8 / 5 * 4 / 8.0 3.0 / 6 * 6 / 2 4 * 3 % 5 * 2 3 * 6 % 5 * 1.5 5 % 3 * 3 % 5 4 % 7 * 7 % 4 3 * 5 % 4.0 * 2 7 % 4 * 7 % 4.0 3.0 % 8 * 3 % 8 12 / 4 % 4 / 4 16 / 3 % 3 / 2 5 / 5 % 5 / 5 / % / 5 * 4 / 3 % 4 3 * 10 / 4 % 4 // ------------------------------------------------------------------------- // Precedence & Associativity - more than 3 operators // // ========================================================================= // Relational // ---------- // Correctness // LessThan, GreaterThan // small op large, large op small, equal op equal // LessEquals, GreaterEquals // small op large, large op small, equal op equal // Equals, NotEquals // integers, reals // small op large, large op small, equal op equal // integers, boolean // small op large, large op small, equal op equal // // Precedence // {LessThan, GreaterThan, LessEquals, GreaterEquals} Vs {Equals, NotEquals} // // Associativity // LessThan, GreaterThan // small op medium op large, large op medium op small, // small op large op medium, medium op large op small, // large op small op medium, medium op small op large, // equal op equal op equal, equal op equal op true/false // LessEquals, GreaterEquals // small op medium op large, large op medium op small, // small op large op medium, medium op large op small, // large op small op medium, medium op small op large, // equal op equal op equal, equal op equal op true/false // Equals, NotEquals // small op medium op large, large op medium op small, // small op large op medium, medium op large op small, // large op small op medium, medium op small op large, // equal op equal op equal, equal op equal op true/false // Precedence & Associativity 3 < 7 9 < 4 4 < 4 3 > 7 9 > 4 4 > 4 3 <= 7 9 <= 4 4 <= 4 3 >= 7 9 >= 4 4 >= 4 3 == 7 9 == 4 4 == 4 3 != 7 9 != 4 4 != 4 3 >= 4 == 4 >= 0 5 >= 7 == 7 >= 0 3 < 7 != 7 < 3 4 < 9 != 9 < 4 9 < 5 < 3 8 < 6 < 4 9 < 3 < 5 8 < 4 < 6 9 > 5 > 3 8 > 6 > 4 9 <= 5 <= 0 7 <= 4 <= 0 4 <= 4 <= 1 7 >= 7 >= 1 9 >= 5 >= 3 8 >= 6 >= 2 4 >= 4 >= 4 7 >= 7 >= 7 9 == 3 == 0 7 == 4 == 0 4 == 4 == 1 5 == 5 == 1 3 != 9 != 1 7 != 4 != 1 4 != 4 != 4 7 != 7 != 7 2 == 3 == 4 == 5 3 == 7 == 5 == 9 1 != 3 != 5 != 7 2 != 4 != 6 != 8 // Arithmetic & Relational // ----------------------- {+, -, *, /, %} X {<, <=, >, >=} {+, -, *, /, %} X {==. !=} 10 / 4 < 10 / 4.0 // Boolean // ------- // Arithmetic & Boolean // // Relational & Boolean // // Arithmetic, Relational & Boolean