CS 115: Introduction to Computer Science 1, UAE edition

Assignment 4 Common Errors

Contracts

Q1: Some students had Q1 contract wrong. The correct contract should be ;;calc-sqrt: (listof num) -> (listof (union nat symbol)).

Q2: Many students used int instead of nat without specifying the restriction [>=0, <256]. The equivalence of nat is int[>=0].

Many students used square brackets for lists in contracts instead of round brackets. For examples, students used [listof num] instead of (listof num[type restriction]).

Tests

Many students did not include a test for the base case. For questions 1 and 3, you should have a test for the empty list. For question 2, you should have a test for the empty string ("").

Valid XHTML 1.0 Strict Valid CSS!

Last modified on Friday, 26 October 2012, at 13:39 hours.

Course Supported by Instructional Support Group