CPSC 217: Assignment 1
Due at 4 PM. For assignment due dates see the
main schedule on the course webpage.
Assignment difficulty
Students may find assignments more challenging than
they first thought. It's best to start work as early as possible. Tips in the
very first lecture were
provided but here's two reminders: 1) work through the lecture and tutorial
material before looking in detail at the assignments 2) start work as soon as
possible. If you find you cannot complete an assignment before the due date then
you will not be granted an extension.
Note: it is not sufficient to just implement a working program
and expect full credit. This is so you implement your solution in the correct
way using good design principles and you apply the necessary concepts. Even
if your program is fully working and the program is not designed or implemented
as specified in the assignment description (e.g. poor variable names used, named
constants not used when they should have employed etc.) then you will not be
awarded full credit.
For some assignments your grade may be greatly reduced. For example, in all the
later assignments you need to employ functional decomposition and do
so in a the proper specified manner. If you do not do this then your maximum
assignment grade point could be as low as 1.0 GPA even with a fully working
program. Although the earlier assignments will not have marking requirements
which are quite as strict,
take
care to read the specific details provided in each assignment which is provided
under the "Marking and grading" section
of each 'full' assignment. The marking of the mini-assignments will focus only on
program functionality.
New Concepts to be applied for the assignment
- Learning how to create a complete
Python program from the ground up using: variables, documentation,
getting input, displaying output, formatting output using escape codes &
format specifiers, using common operators. These things were covered in the
"introduction to programming lectures" and the respective
tutorials so you need to go through this material before starting the
assignment.
- If you want credit for your work: Do not use any
pre-created functions/methods unless you are given explicit permission to do
so. [Generic list of
allowable library functions]
Synopsis:
Implement a program with the features listed under the functional
requirements. You must save your program in a file called "grader.py".
Failing to use this exact name will affect your grade.
Write a python program that will perform the actual calculations used to
calculate your term grade. The formula for calculating a weighted term grade was
covered in the first set of lecture notes dealing with administrative issues
such as grading but the basics are simple. The weighted grade for a component
(whether that grade is a GPA, percentage or raw score) = (grade for the
component) * (weight of that component). This product is calculated for each
component and the weighted component grades are summed to yield a term grade.
The user will be prompted to enter the grade point for each
course component after which the weighted grade point will be calculated for the
major course components and displayed along with the term grade point as well as
the original grades. This output must be formatted using the appropriate escape code and format specifier.
- The program starts by prompting for the
grade point (0 - 4.3) for each of these components (assignments and
mini-assignments) one-at-a-time (refer to
Figure 1).
- To reduce errors the program needs to display the valid range of
values to be entered (0 - 4.3). Although you won't be eligible for a
bonus (>4.0) for some of the assignments this term you can make the
simplifying assumption for your prompts that bonuses are possible
everything.
- Error checking this range is not needed in your program because you
haven't been taught 'branching' yet. (Assume that the user enters a
value with the correct range).
- Also your program doesn't have to check for invalid types of
information being entered (e.g. the user enters a string instead of
numbers for a grade point) because you won't have learned "exception
handling" until much later in the term.
- You should however document these problems as current program
limitations (see the "non
functional requirements" section).
- Next the program calculates and displays output: the weighted grade
points for each the assignments, mini-assignments along with the original
grades and the term grade point (refer to Figure
2).
- Each grade point will be display with one place of precision
(specified by the correct use of the format specifier),
precision is the number of digits right of the decimal point. (If you still don't
know what this means here's
an article explaining these terms). The precision
must be specified with a
correct format specifier.
- Tabs (each one must specified with the appropriate escape code) will separate
each piece of information (label or individual grade).
- <Full assignments:> <tab> <GPA for A1> <tab> <GPA
for A2> <tab> <GPA for A3> <tab> <GPA for A4>
- <Mini assignments:> <tab>
<GPA for mini-A2> <tab> <GPA for mini-A3a> <tab> <GPA
for mini-A3b> <tab> <GPA for mini-A4a> <tab> <GPA for
mini-A4b> <tab> <GPA for mini-4c>
- <Weighted full assignments> <tab> <Weighted
GPA for all the full assignments>
- <Weighted mini-assignments> <tab> <Weighted
GPA for all the mini assignments>
- <Term GPA:> <tab> <Term GPA>
- The angled brackets do not actually appear in the
output, they are only used to separate different pieces of information. The
spaces between the fields shown above are only included for readability and do
not appear in the final output (e.g. there is only a tab between A1 & A2 not a
space and a tab).
- The column for the labels ("Full assignments",
"Mini assignments" etc. must be right aligned using a correct
format specifier (field width) so that the colons line up
on top of each other). Alternative approaches (e.g. typing a bunch of spaces
between the quotes in the print
function) will be awarded no credit. See the lecture material
covering format specifiers on how to align a column of output
("Introduction to programming Part 2").
Explicit reminder to be awarded credit for the formatting output:
- Format specifiers must be used when a column width or column alignment is specified
(e.g. right or left alignment).
- Also format specifiers must be used to specify
the number of places of precision for numerical information.
- Other formatting effects (e.g. tabs, newlines) must be implemented using escape codes (e.g. add tabs between columns).
Figures showing the program getting input from the
user and displaying program output

Figure 1: Getting input

Figure 2: Output of the original grades, the
weighted grades and the term grade point.
How to do determine 'how you did' on
an assignment?
Program functionality (implementing working program features)
-
Test your program: Because the [marking
key] is posted ahead of time if you test your program thoroughly
before submitting the final version then you should get a pretty clear
idea of "how you will do".
Style and documentation (non-functional assignment requirements)
- Style and documentation requirements were introduced early in the
semester in the "Introduction to programming"
section of the course. Additional requirements may be added as new
sections are covered (e.g. documenting functions that you write your
yourself). Each assignment will specify these requirements specific
[under the
non -functional assignment requirements (style and
documentation). ] to that graded component. Again you should refer to
the [marking
key] in order to determine how style
and documentation will affect grading for a particular assignment.
Optional python feature that you can use
The calculations for the weighted grade points for each
major course component can be long but python won't allow you to simply hit
enter and continue a instruction on the next line. (You must use the line
continuation character (back slash) properly). Here's a [simple
example] illustrating how it works.
Testing your program:
Normally you should "hand
trace" your program and compare the results of running your program. The
calculations are a bit long in this case so for this assignment You can use
the [grade calculator spreadsheet] to compare results.
- Naming conventions: You should employ good naming conventions for
identifiers (variables and constants) as covered in the "Introduction to
programming" section of the course.
- Defining and using named constants. Although this
assignment does not specifically require the use of named constants later
assignments will do so and it would be good practice to start employing this
practice now.
- Python documentation: This should be specified
in the header of the program (very top of your program in the form of Python documentation).
The basics of documentation were covered in the "Intro to programming"
section of the course. Later sections may include additional details.
-
Identifying information:
All assignments should include contact information (full name, student ID
number and tutorial section [Here's
a
Link if you don't know how to find this information]) at the very top of your program.
- Program version.
(version date or version number).
- Under the version you
should specify which assignment features were implemented in that version.
An example covering the use of program versioning and documentation was
covered in the "Introduction to programming" lectures.
-
Any program limitations or weaknesses.
- As mentioned your prompts to the user to enter the
required information must be clear to the user as to what should and
should not be entered.
- In general: The program output and the program code itself
(python program) must be properly aligned and formatted including whitespace
as needed to group related parts and separate sections (which again was
covered in the "Intro to programming" lectures of the course.
Additional requirements in the formatting of output may be included in the "Functional
requirements" section of the assignment.
Having at least one violation in one of the above
categories 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 and no documentation of features and no documentation of weaknesses will receive a -0.3 penalty).
-
What to submit:
Submitted programs must run on the computer science network (i.e. the
computer rooms were your tutorials are conducted) running Python 3.x. If you choose to install Python on your own computer
then it is your responsibility to ensure that your program will run properly
on the computer science network. Options for doing this remotely were
detailed in the [getting started as a
computer science student help link]. It's up to you if you wish use the graphical
program builder other than 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.
Windows users: take care that you don't
accidentally submit a shortcut to a file instead of the actual file.
(Check the file name and compare the file size to your original file. Simply
downloading the shortcut file as a test won't work because that shortcut
will work on your computer but not on anyone else's machine and your work
won't be graded.).
-
Late assignments or components of
assignments: Extensions
may
be granted for reasonable cases by the course instructor with the receipt of
the appropriate documentation (e.g.,
a
statutory declaration with a commissioner
of oaths). Location of the online form: [PDF
file].
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.
-
Assignment extensions
(before the assignment is due):
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, forgetting or mixing up due date 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 [link to : tutorial
and TA information) because the markers won't accept
late submissions without directly getting an email from me and I need to
know who to contact. Also extensions need to be requested before the
due date and not afterward.
-
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 or concerns about grades after they have been released:
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 before going
into your concerns.
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].
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.
-
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.
-
How often can you submit: Multiple
submissions are allowed for this assignment: You can (and really should)
submit work as many times as you wish before the due date.
However only the latest file submitted is the one that will be marked,
everything else will be ignored (because it is not fair to your marker to
sort through multiple versions of your files).
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) |
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.