CS 115: Introduction to Computer Science 1, UAE edition

Assignment 5 Common Errors

Contracts

  • Many students used num instead of int or nat in contracts. Note that you must use the most appropriate data type. The type num allows all real numbers as valid parameter values. Several of the functions clearly specified only integer (int) or non-negative integers (nat) should be consumed.
  • Q1: Many students used (listof competitors) instead of (listof competitor). The exact name of competitor (structure name) should be used.

    Examples

    Many students only included one example for main function. One example is not sufficient, at least 2 examples are needed for each function.

    Tests

    Always test the boundary case. The test cases that students often missed are:

    • Question 1
      • Test where the function consumes a list of 3 elements.
    • Question 2
      • Test where the function consumes the value 1.
    • Question 3
      • Test where the function consumes the empty list.

    Whitespace

    • For easier readability, please leave a single blank line in between your examples and body, your body and tests and between functions (including helper functions).
    • If too much code or text is on one line, please break your code in a logical place onto another line and indent appropriately.
  • Valid XHTML 1.0 Strict Valid CSS!

    Last modified on Friday, 16 November 2012, at 16:21 hours.

    Course Supported by Instructional Support Group