CPSC 231: Mini-Assignment 5
Due at 4 PM. For assignment due dates see the [main
schedule] on
the course webpage.
New Concepts to be applied for the assignment (because
there likely won't be time to cover GUIs and graphics in lecture it is even more
important that you attend tutorial and understand the examples covered).
- Writing a program that reacts to button events using the tkinter module
(to keep things consistent do not use another module).
- Drawing basic shapes and setting graphical properties using the tkinter module
(to keep things consistent do not use another module).
Only new concepts that need to be applied in the assignment are
listed, concepts previously applied in other assignments may need to used in the
implementation of your solution. Since the program you write will likely be
fairly short it can be all included in a single file/module. Defining a new
class is not needed but you will have to implement a new function (to react
to the button event).
Modify the existing code in the program [starting
program] to draw the graphic of a rectangle that appears in a new Window
when the button is pressed. (For this assignment it's acceptable that the button
and window are both globals). The rectangle (which is added to the popup window)
with have the following properties.
- Dimensions of the new window (width=1024,height=768)
(worth 1.0 GPA)
- Properties of the rectangle (which appears in the
window):
- Coordinates of top left hand corner (50,100)
(worth
1.0 GPA)
- Coordinates of bottom right hand corner (250,200)
(worth 1.0 GPA)
- The rectangle is draw in bold colors: filled in 'pink', outlined in
'orange'
(worth
1.0 GPA)
It's important that you set the values precisely as specified so the marker
can tell you know exactly how/when to set the graphical properties when getting
your program to react to the button press event. The figure below shows a screen
capture of the popup window as the bottom was pressed in my solution. If you
need to see the entire chain of events from execution to button press here is a
[video capture].

How to do determine 'how you did' on
an assignment? (Short answer: you can thoroughly test your program and become
familiar with non-functional requirements)
Program functionality (implementing working
program features)
-
Test your program: Because the
assignment description (along with required features) 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".
This should be easy verify especially if you pay attention to the
details of assignment requirements and you can verify the results
visually as well.
Style and documentation (non-functional assignment requirements)
- To keep the marker's workload reasonable and to reduce marking time
unless otherwise specified in the description these things will not
factor into the grading of mini-assignments.
Although it won't affect your grade for mini-assignments you should still
practice applying good style in your solution as well as writing
documentation. It will keep your skills for the full assignments (when you will
be graded on these things) and get you used to having good habits.
- Naming conventions: You should employ
good naming conventions for identifiers (variables and constants) as covered
in the "Introduction to programming" section of the course.
-
Your file must be specifically
named as specified under the specific point [Naming
the file] under the "Marking and grading" heading.
- Named constants should be used as
appropriate.
- 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.
- 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.
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 see your assignment grades the marker is the
person should be directing your questions towards.
If
you still have question after you have talked to your TA, then you can of
course talk to your [course
(lecture) instructor] but please indicate in your
email that you first contacted your TA before going into your concerns.
If you don't know which tutorial section you are officially registered in
then you can find this information in the Student Center in the [PeopleSoft
university portal].
How you will be graded
for mini assignments.
Since the grading for mini-assignments is often simple
(unlike full assignments a separate grading spreadsheet is not needed)
you can find feedback, when it's applicable, in D2L under Assessments->Dropbox and
then clicking on the appropriate assignment link.
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;
don't even verbally discuss solutions to any graded work (i.e. you can't do this
in an exam so you can't do this for assignments).
And unless otherwise told you should not use program code for other sources
(which include but aren't limited to: tutors, artificial intelligence programs
such as ChatGPT). For more detailed information as to what constitutes academic
misconduct (i.e., cheating) for this course please read the following [link].
Method of submission:
Reminder: 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, it
is the correct file
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. Whatever
you submitted into D2L by the final due date is what will be marked.
-
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).
-
What to submit: Python programs only (file name ends in .py)
Any other type of file will be rejected by D2L.
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 |
Penalty: |
None |
-1 GPA |
-No
credit (not accepted) |
This assignment is significantly
different from the others. Because it involves implementing a graphic user
interface (GUI) you are not restricted in the use of external libraries/modules.
You do of course have to implement the GUI specified in the assignment
requirements.