$30
CSC 242: Introduction to Computer Science II
Lab exercise set 4
Logistics
You are encouraged to work in groups on lab exercises. If you do work with someone, you must
include the name(s) of your collaborator(s) at the top of the file you submit. For more
information about collaboration policies in this class, see the Academic Integrity policy.
If you complete the lab exercise early, please review Chapter 9 in the textbook and work on the
fourth assignment or study for the midterm exam. You must remain in the lab for at least 45
minutes to earn full credit. You are only allowed to work on assignments with at most two-other
people, either directly or indirectly, who must be formally identified as part of your assignment
submission. Please see the assignment description and the course Academic Integrity pledge for
the full description of the process you must follow when completing assignments. If you need
additional help on the assignment, please ask the lab assistant.
Exercise
Begin the lab by downloading the template file (csc242lab4.py) contained in a zip file from the
D2L site. There is an example named HellowWorldObject.py we covered in class that you can
look at.
1. Implement a simple window that will be used to display electronic signage. The window
should be implemented as a class named Sign. I have given you some code to get started.
The window should look exactly follows. The text in the window needs to be displayed
*exactly* as shown for full credit.
2: Modify the Sign() class to take in an optional parameter of type list that has 3
sentences that can be displayed on the screen. If there aren’t three items in the list, then
the default message as shown in problem 1 will be displayed.
Example usage:
>>Sign().mainloop()
>>> lst=[]
>>> lst.append("The key to the lab is to add multiple labels")
>>> lst.append("This list will be stored in an instance variable")
>>> lst.append("The text property of the labels will be set to each of these message")
>>> Sign(lst).mainloop()
Submitting the exercises
You must submit your solutions to the exercises using the lab 4 dropbox on the D2L site. Submit
only a single Python file (e.g. csc242lab4.py) with each of the completed functions and classes
for the lab exercises in it. Submissions after the deadline listed above will be automatically
rejected by the system. See the syllabus for the grading policy.
Grading
The lab session is worth 10 points. If you complete the lab exercises before the end of the lab
session, please work on the fourth assignment. Remember that the rules for collaboration on
assignments is different from labs. Please review the Academic Integrity policy for more
information. If you have questions about the assignment, please ask the teaching assistant for
help.