As you complete the exam, please take a moment to reflect on how much you have learned since the first day of class and how much you have done. Computer Science is not for the faint of heart.
Make sure you read and follow ALL the instructions carefully. Failure to follow instructions will, at best, result in a large point deduction and could result in a 0 for the exam.
¶ Guidelines and Requirements
Remember this is an EXAM.
You may use any online and/or class resources you want, but you must complete the exam on your own. Double check your submission (a couple times). I will not accept a late submission for ANY reason without a significant point penalty.
Plan ahead.
You may ask clarification and conceptual questions; however, because this is an exam, we cannot look over or help you debug your code. If you are unsure, ask. We will tell you if we can help you or not.
Finally, you may not use entire code blocks from another assignment without alteration. For example, copy and paste an entire function unchanged from a previous exercise. If you use a code block from another assignment other than common snippets, you will not receive credit for that portion of the exam.
Essentially, make the code as best you can and be creative. That is the primary requirement .
Below are the specifications I will use for grading.
- [5] Completed README.md file in the
midterm
folder of Ch 6
- [20] Clean Code: -1 point for each convention not met
- Imports
- imports ALWAYS go on at the top of the file before any code
- Variables
- All values should be stored in a variable. Values put directly into an expression without first storing the value in a variable are called “Magic Values”.
-
bad:
print(456)
- good:
num_oranges = 456
print(num_oranges)
- Variable names all start with a lowercase letter.
- No single letter or non-descriptive variable names
- var doesn’t tell you what the variable is for
- CONSTANTS are in all caps
- A constant is any data that will never change in any program, such as PI or the RGB code for red, (255, 0, 0).
- Output
- Output is formatted with an explanation of the output values
- bad: 456
- good: you have 456 oranges
- Functions
- Only imports, constants, function definitions, and the call to main() are in global scope
- You should not have any executable code in global space
- Your driver code is enclosed in a main
def main():
#your top level algorithm
- Function and Variable names all start with a lowercase letter.
- Unless functionally required not to, by default, function parameters should be named with default values.
- Each function, with main() being the ONLY exception, should have a docstring that uses the following format:
def myFunction(arg1=0, arg2=None):
'''
general function description
args: (type) description
return: (type) description
'''
- Overall Code Quality:
- Variables are well named
- Functions are well named
- The overall code is DRY
- Functions are written to be modular
- [30] Functions
- [10] correct function definitions
- [10] correct use of parameters
- [10] correct use of return values
- [30] Creativity and Uniqueness
- [15] Creativeness of drawing
- [15] Uniqueness as compared to classmates
If you do not have an midterm
folder in Ch 6, create one
Create a file called README.md
in your midterm folder, then use the following template to fill in the requested information before you submit. Make sure you name it exactly, follwing case and puncuation.
Add the requested information below each second level heading, ##
. If it doesn't apply, just put Nope
.
# CS110 Midterm Exam
## SHORT DESCRIPTION *(1 or 2 sentences describing your program)*
## KNOWN BUGS AND INCOMPLETE PARTS *(list any known bugs or non-working parts)*
## REFERENCES *(any resources you use outside of class materials)*
## MISCELLANEOUS COMMENTS *(anything else you would like the grader to know)*
Next, use the turtle library to draw something. It can either be a picture, such as a happy face or flower, or a graph of something. The choice is yours. There is no right answer beyond meeting the guidelines.
As you are writing your program, focus on the following:
- Code Quality
- DRYness - how dry is your code? Is there any unnecessary code? Can any code be compressed to a loop? a function, etc?
- Modularity - How modular is your code? Do you break it into small functions? Did you hardcode values or save them in an easy to identify variable? How reusable are your functions? etc.
- Conventions - Are you following programming conventions? i.e. imports at top, no single letter variable names, using a main() driver, etc.
- Functions
- Your program must have a main function and at least 1 additional function.
- You must have a function in your program that:
- takes and uses parameters
- returns a value that is used by your program
- These requirements may be met by a single function in addition to main()
WARNING: If you write a function that does not get called in your code, do not use the parameters in the function, or do not use the return value in your program, you will not receive credit for that portion of the exam.
- Creativity and Uniqueness
- Creativity: Come up with something of your own. Don't worry about whether or not it is 'good', just make it yours. For example, if you simply draw a square on screen, as we have done in class, you will lose points for creativity.
- Uniqueness: If 50% of the class draws a smiley face, and the only difference between yours and the others is color, then you will only recieve 50% of the score for this portion of the exam.