- Information
- AI Chat
Was this document helpful?
9. Recursion - Assignment 9 on Recusions
Course: Computer science1015 (CSC1015F)
257 Documents
Students shared 257 documents in this course
University: University of Cape Town
Was this document helpful?
Version: 2024/04/15 11:27:07
Page 1 of 5
CSC1015F Assignment 9
Recursion
Assignment Instructions
This assignment involves constructing Python functions that use recursion. You must NOT use loop
constructs (such as ‘for’ and ‘while’) in your solutions.
There are four questions. The first concerns identifying palindromes, the second two concern
constructing a module containing pattern matching functions. The last concerns the identification of
palindromic prime numbers.
Assessment
Your code will be automatically marked. Say that there are N trials for a question. The first (N-1)
trials will check that your code functions correctly by executing it on test inputs. The Nth is a penalty
test. It scans the code for evidence of the use of iteration or the use of list/string reversal
expressions. If it finds evidence, then it deducts the marks for the question.
In some cases, the penalty test will report a false positive. For instance, it thinks you're using loops
but you are not, you simply have a variable name containing the word 'for', e.g. 'former', 'afford'.
Furthermore, your solutions to this assignment will be evaluated for correctness and for the
following qualities:
• Documentation
o Use of comments at the top of your code to identify program purpose,
author and date.
o Use of comments within your code to explain each non-obvious functional
unit of code.
• General style/readability
o The use of meaningful names for variables and functions.
• Algorithmic qualities
o Efficiency, simplicity
These criteria will be manually assessed by a tutor and commented upon. Up to 10 marks will be
deducted for deficiencies.