CPSC 217: Assignment 1
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.
New Concepts to be applied for the assignment
- Learning how to create a complete
Python program from the ground up (variables, constants, documentation,
getting input, displaying output, formatting output using escape codes &
format specifiers, using common operators).
- To get credit for formatting output: The format
specifiers are to be used when a column width or column alignment is
specified (e.g. right or left alignment). Also format specifiers are to be
used to add trailing or leading spaces. Escape codes can be used to add tabs
between columns.
Creating your first Python program
Write a python program that will perform the actual calculations used to
calculate your term grade including all components (3 full assignments, 6
mini-assignments and the 2 parts of the course project). It will prompt for the
grade point (0 - 4.3) for each of these components one-at-a-time
(Worth
0.05 GPA)

Figure 1: Getting input
You can assume that the user will only enter a grade point from 0 - 4.
Your program does not have to error check that the user
actually entered a value within this range because you will not yet have yet
learned how to do this yet. Just assume that the user enters a value within 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). You should however document these things as current program
limitations.
After getting the 11 values the program will calculate
and display
(Worth
GPA 0.6) the weighted grade points for each of the full assignments, mini-assignments and
the project:

Figure 2: Displaying weighted grade points
for the three major components
The weighted grade points should include a heading preceding the three values
("Weighted term grade points") and the lines will precede and follow the three
values. Fractional values should be displayed to one place of precision
(Worth
GPA 0.3)otherwise the text should appear as shown in Figure 2 (e.g. no extra spaces
after the equal sign and the number).
The term grade point will be calculated
and displayed
along with the original information entered by the user:
- <Label: Full assignments:> <tab> <GPA for A1> <GPA
for A2> <GPA for A3>
- <Label: Mini assignments:> <tab> <GPA for mini-A2>
<GPA for mini-A3a> <GPA for A3b> <GPA for A4a> <GPA for A4b> <GPA for A4c>
- <Label: Project:> <tab> <GPA for Part I> <GPA for
Part II>
- <Label: Term GPA:> <tab> <Term GPA>

Figure
3: Displaying the original input along with the term grade point
Note how the information in Figure 3 is formatted:
- The column for the labels ("Full assignments",
"Mini assignments" etc. should be right aligned so that the colons line up
on top of each other). (Worth
GPA 0.8)
- A tab separates Column 1 (Text labels) from Column
2 (first GPA) (Worth
GPA 0.05)
- Each of the grade points is followed by a trailing space
(i.e. left align the column) by setting the
field width format specifier (not a leading space, not by manually typing in a
space character). (Worth
GPA 1.1)
- As before one place of precision should be displayed for the
rational portion. (Worth
GPA 1.1)
- The separator line shown at the top Figure 3 is
continued from the information at the end of Figure 2.
Non -functional assignment requirements (style and
documentation).
- Naming conventions: You should employ good naming conventions for
identifiers (variables and constants).
- Documentation: contact information (your name,
student identification number and tutorial number). This should be specified
in the header of the program (very top in the form of Python documentation).
- Named constants should be used for each of the
weights. That is, how much each of the following contributes to the term
grade: full assignments, mini assignments, project.
- Finally your prompts to the user to enter the
required information should be clear to the user as to what is required.
Having at least one violation in one of the above 4
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 constants will receive a -0.2 penalty).
Submitting your work:
- The document must be electronically submitted
using D2L. This
applies to on-time or late submissions.
- D2L configuration for this course
- Multiple submissions are allowed for this assignment: You can (and
really should) submit work as many times as you wish before the due
date. Due dates are strict, only what is in D2L by the deadline is what
will be marked. Other methods of verifying that your work was completed
on time (e.g. checking timestamps, emailed files etc.) will NOT be
accepted.
- Multiple files can be submitted for this assignment (e.g.
A1_version1_May7, A1_version2_May8 etc.) Consequently all versions of
your submissions will be retained. However only the latest versions of
each individual document (for assignments that require multiple files to
be submitted) are the ones 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).
- Do not use compression utilities (such as zip) or archiving utilities
(such as tar) otherwise your submission may not be marked
- 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 your submit your assignment with enough time before it
comes due for you to do a check)
Marking
-
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.
- 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]
Points to keep in mind:
-
Due time:
All assignments are due at 4 PM on the
due dates
listed on the course web page. 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.
-
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).
-
Identifying information:
All assignments should include contact information (full name, student ID
number and tutorial section) at the very top of your program in the class where the 'main()'
method resides (starting execution point). (Note other documentation is also required for most
assignments).
-
Collaboration:
Assignments must reflect individual work;
group work is not allowed in this class nor can you copy the work of
others. For more detailed information as to what constitutes academic
misconduct (i.e., cheating) for this course please read the following [link].
- Execution:
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. If it won't run using Python 3.x then it
won't be awarded credit. It's up to you if you wish use the graphical
program builder IDLE to write/run your programs but if you do you submit your program in the form of
text ".py" file or files.
-
Use of pre-created Python
libraries:
unless otherwise told you are to write the code yourself and not use any
pre-created functions. For this assignment 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
classes that you are allowed to use and still get credit in an assignment
submission.
-
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.
-
Late submissions (no extension granted):
|
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 |