CPSC 217: Assignment 5

Due at 4 PM. For assignment due dates see the main schedule on the course webpage. The program must be written and run under python version 3.X.

Sections for this project

Program writing portion (Worth 3.7 GPA)

New Concepts to be applied for the assignment

Only new concepts that need to be applied in the assignment are listed, concepts previously applied in other assignments may be needed in the implementation of your solution.

Critical design requirements

All instructions must be enclosed within the body of a function, you must write at least 2 functions that implement features specific to this assignment. One function should be related to file input and the other should be the start function. Students can implement more than one function for file input if they wish. However, functions implementing features for the previous assignment (e.g. display of the list) isn't included in the count. The functions you write must be properly implemented. No global variables  may be employed. 

The exceptions to including all code inside the body of a function could include: import statements (not really needed for this assignment), the creation of global constants (e.g. ATTIC = 1), a global debugging flag and the call to the initial start or main function.

Contrary to student rumours these penalties are not specified in order to "curve the grades down" or to only allow a certain number of students to pass the course. Besides learning the mechanics of defining and calling functions you need to use them properly. For instances you shouldn't complete a course that teaches you how to write short stories and pen tales that are grammatically correct and may even use metaphorical references and include multiple characters if they include hackneyed metaphors and shallow character development. Because the penalties are quite strict then typically most/all (hopefully the latter) students will implement their solutions in the correct fashion.

Functional requirements (features your program is to implement)

Reading the starting patterns from a text file (10x10 world) into the 2D list (worth fewer marks). [Directory containing the cases for previous project in the form of text files]

The starting patterns of critters will be in square pattern (10 rows, 10 columns) so your program will only have a fixed size biosphere. Similar to the last mini assignment the name of the input file can be chosen by the user.

  • Prompt the user for the name of the input file & if the file is empty it will display an error message.
  • Open the input file and read the starting pattern of critters and empty spaces into the world.
  • If there is any problems associated with the file (cannot open, file is empty, there is an error during the read process) then the program will display an appropriate error message and repeatedly prompt the user for the name of the input file and begin the file read process anew.

Reading the starting information from any arbitrarily sized rectangular file into the 2D list (worth a greater number of marks) [One example input file]

The starting pattern of critters will be from any sized rectangular sized grid (minimum of 1 row or column to a maximum of 20 rows x 30 columns. (Theoretically your program should be handle a larger input file but there may be problems displaying the results in a reasonable fashion).

In order to get credit for the previous features your program must be able to implement the features from the first part of the project such as:

To help you visualize the layout of the starting input files you may want to view an example starting input file with [formatting marks turned on in Word]. Also you might want to create test files of various sizes using Word (but making sure you save them as .txt files). Of course to be able to check if your program has completed the above tasks successfully the program needs to display the state of the simulation.

In addition to grading on whether the above functionality was correctly implemented TAs will also look at documentation and style.

Turning on formatting marks in Word (seeing the invisible characters in a text document).

Open the input file using Word (you should be able to access Word via the student license for Office 365 - although the specific location in that version of Word may be slightly different for invoking the feature to display formatting marks - without charge while you are U of C student) and turn on 'Formatting marks'

Home ribbon -> (Paragraph group) and click on the Show/Hide icon

Characters that aren't visible such as spaces, tabs and the newline (enter) appear in this display mode

Non-functional assignment requirements (style and documentation).

  • Python documentation: contact information (your name, student identification number and tutorial number). This should be specified in the header of the program (very top of your program in the form of Python documentation).
    • Identifying information: All assignments should include contact information (full name, student ID number and tutorial section) at the very top of your program.
    • Program version (dates are an acceptable alternative)
      • Under the version you should specify which assignment features were implemented in that version.
    • Any program limitations or weaknesses.
    • If you don't know how to document a program then refer to the "Intro to programming" section of the course.
    • New documentation requirement starting with A3 and applies to all successive assignments: [Inline documentation] (specified just before each function is defined): list the features of the program that were implemented in a particular function, the return type(s) as well as the type(s) of the arguments.
  • Style requirements (-0.1 penalty for each now violation of a category there is no maximum cap on the number of style penalties that may be applied (5 categories of penalties means that a maximum penalty of -0.5 may be applied)
    • Naming conventions: You should employ good naming conventions for identifiers (variables, constants, function names, program file names).
    • Named constants should be used as appropriate (i.e. if they aren't defined and used when they should be then a penalty will be incurred).
    • Yes do it this way! No. Not this way!
      #Defining 3 named constants
      LEFT
       = 0
      RIGHT = 1
      CENTER = 2
      #Using the named constant 'RIGHT'
      if (silverLockPosition == RIGHT):
      if (silverLockPosition == 0): #What does 0 stand for???
    • The program code should have appropriate white space (specified in the "Intro to programming lecture') and alignment (specified throughout the lecture notes).
    • Code is self documenting e.g. Clear expressions (e.g. mathematical, Boolean). Good variable names and the use of named constants are examples of writing self documenting code but specifying clear expressions is important enough to be included in a separate category.
    • Of course if a student implements an extreme case of inefficient code (e.g. multiple loops or branches are used when one will do) then penalties may be applied but this is generally rare.
    • Your program should follow the 5 rules of thumb for designing user friendly software (distilled from Jakob Nielsen's 10 usability heuristics) which were included in the notes on 'Repetition' e.g. good error handling (such as prompts to the user to enter the required information clearly indicate what is required, good error messages should be provided for erroneous input) minimizing the user's memory load, being consistent, providing clearly marked exits & providing feedback as appropriate.
    • Having at least one violation in one of the above general style requirements will result in -0.1 penalty to marking. Multiple violations in one category still results in a single penalty (e.g. 3 bad variable names will still result in a -0.1 penalty). However violations between categories will result in cumulative penalties (e.g. a program that includes poor variable names, messy program layout and poor error handling will receive a -0.3 penalty)

       

  • Function specific style requirements (principles of good design for functions) -0.2 penalty will be applied for each of the 3 function specific style requirements that have been violated.
    • Functions are one screen in length (normal screen resolution say ~30 lines max of code (excludes whitespace and documentation).
    • Functions implement one well defined task (Appropriate: processLivingRoomCommands() vs. something that's not appropriate  processlivingRoomRunIntroductionRunConclusion()).
    • Code in one function is not duplicated in another function (not in the notes but this is just common sense that you don't write two functions where there's overlapping code - the overlap should likely be taken out of both functions and moved to another separate function). In some assignments there may appear to be some overlap (e.g. each room displays a menu of options but the specific options displayed will not be identical.
    • Violating any of the function specific style requirements will result in a -0.2 penalty for a violation in each of the 3 categories. E.g. a program that includes a function that exceeds the maximum length and implements two or more tasks would incur a -0.4 penalty.

Reminder of critical style requirements

Don't forget that [critical design requirements] (proper use of functions, no global variables) must also be followed.

Marking and grading

  • What to submit: In a typical semester submitted programs must run on the computer science network running Python 3.x. If you write you code in the lab and work remotely using a remote login program such as Putty or SSH then you should be okay (assuming you don't login to a non-Linux computer). If you choose to install Python on your own computer then it is your responsibility to ensure that your program will run properly here. Remote learning version: If it won't run using Python 3.x on any computer then it won't be awarded credit. It's up to you if you wish use the graphical program builder IDLE (or another development environment rather than a simple text editor) to write/run your programs but if you do you submit your program in the form of text ".py" file or files.
  • Late assignments or components of assignments: will not be accepted for marking without approval for an extension beforehand. Alternate submission mechanisms (non exhaustive list of examples: email, uploads to cloud-based systems such as Google drive, time-stamps, TA memories) cannot be used as alternatives if you have forgotten to submit work or otherwise have not properly submitted into D2L. Only files submitted into D2L by the due date is what will be marked, everything else will be awarded no credit. The final cut off date after which full assignments will not be accepted is after the maximum progressive penalty (listed below) can be applied. The final cut off date for mini-assignments is the due date because no late submissions are allowed for these smaller programs.
  • Extensions may be granted for reasonable cases by the course instructor with the receipt of the appropriate documentation (e.g., a sworn declaration with a commissioner of oaths). Typical examples of reasonable cases for an extension include: illness or a death in the family. Example cases where extensions will not be granted include situations that are typical of student life: having multiple due dates, work commitments etc. Tutorial instructors (TAs) will not be able to provide extension on their own and must receive permission from the course instructor first. If you request an extension from me let me know the name of your tutorial instructor and the tutorial number because the markers won't accept late submissions without directly getting an email from me.
  • How you will be graded for full assignments. As mentioned, as well as being marked on whether "your program works" you will also be marked on non-functional requirements such as style and documentation. Consequently this assignment will include a separate [marking checklist]. Besides seeing your grade point in D2L you can also see the detailed feedback that your TA will enter for each student. You can access the grading sheet in D2L under Assessments->Dropbox and then clicking on the appropriate assignment link. If you still cannot find the grading sheet then here is a [help link]
  • Questions about grading afterward: Assignments will be marked by your tutorial instructor (the "Teaching Assistant" or "TA") for your [tutorial section]. When you have questions about marking this is the first person that you should be directing your questions towards. If you still have question after you have talked to your TA, then you can talk to your [course (lecture) instructor] but please indicate in your email that you first contacted your TA. Because I will grade the quiz if you have any questions then you should contact me (course instructor) rather than the TA.

Method of submission:

You are to submit your assignment using D2L [help link]. Make sure that you [check the contents of your submitted files] (e.g., is the file okay or was it corrupted, is it the correct version etc.). It's your responsibility to do this! (Make sure that you submit your assignment with enough time before it comes due for you to do a check). If don't check and there were problems with the submission then you should not expect that you can "learn your lesson" and simply resubmit.

D2L configuration for this course

  • Multiple submissions are allowed for this assignment (all versions are kept in D2L): You can (and really should) submit work as many times as you wish before the due date. However only the latest version of all the files is what will be marked, everything else will be ignored (because it is not fair to your marker to sort through multiple versions of your files).
  • Do not use compression utilities (such as zip) or archiving utilities (such as tar) otherwise your submission may not be marked. The space savings in D2L is not worth the extra time required by the marker to process each submission.

Late submissions for full assignments when there is no extension granted: Make sure you give yourself enough time to complete the submission process so you don't get cut off by D2L's deadline (or your submission will be automatically flagged as late by D2L and it will be graded appropriately)..

Submission received:

On time

Hours late : >0 and <=24

Hours late: >24 and <=48

Hours late: >48 and <=72

Hours late: >72 and <=96

Hours late: >96

Penalty:

None

-1 GPA

-2 GPA

-3 GPA

-4 GPA

No credit (not accepted)

Collaboration:

Assignments must reflect individual work; group work is not allowed in this class nor can you copy the work of others. Some "do nots" for your solution: don't publically post it, don't email it out, don't show it to other students.  For more detailed information as to what constitutes academic misconduct (i.e., cheating) for this course please read the following [link].

Use of pre-created Python libraries:

Unless otherwise told you are to write the code yourself and not use any pre-created functions (or methods). For most assignments the usual acceptable functions include: print()input() and the 'conversion' functions such as int()float()str(). Look at the particular assignment description for a list of other functions/methods that you are allowed to use and still get credit in an assignment submission. If it's not listed then you should assume that you won't be able use the function and still be awarded credit. Note: This is a prohibition on using functions that someone else has wrote. You can (actually must) define your own functions for this assignment.

Short answer portion (Worth 0.3 GPA)

It will completed as a D2L quiz which will be opened for access 72 hours before the due date. One question will come from the lecture notes "Introduction to Computer Science" while the other question will come from the lecture notes "Computer history". During the time it's available you can find the quiz in D2L under: Assessments->Quizzes->Project Part short answer.

Submitting your work (D2L quizzes):

Finding your grade for the short answer portion

After grading is incomplete you can find your grade for the Short answer portion in D2L under: Assessments->Grades. You won't see it in the D2L Dropbox because you supplied your answers as a D2L quiz not along with the python program part of this project. I will be marking this portion of Project Part II so if you have questions then you can direct them to me.

Mapping of raw score to grade point for the short answer portion

Min raw score GPA
0 0
1 0.06
2 0.09
3 0.12
4 0.15
5 0.18
6 0.21
7 0.24
8 0.27
9 0.3