Computer Science I
PA 03
Using multiple methods to create a collage
Due by Wednesday, February 25th at 9:00 AM
In both PA01 and PA02 you wrote several unrelated methods. This week,
you will once again write several methods, but you will do so in the context of
one larger project.
High Level Overview
- You should define a function called generateFlag()
- This method should return a picture which is a
collage consisting of at
least three images
- The images should be modified in such a way that you adjust their color to
correspond with the colors on the flag.
- This collage should loosely resemble the flag of a country of your choice
For example, the flag of Italy looks like this:

I made a flag collage using images that I took on a hike in Italy last summer

Specifics
- You should create a folder called pa03
- Inside of this folder should be a file called pa03.py
- This file must contain a method called generateFlag() that
- takes NO PARAMETERS
- prints a message to standard output (the print command) indicating
which country's flag you are attempting to produce
- creates a new picture canvas using makeEmptyPicture(width,height).
While you may make your flag collage any size you like, please keep it
within reason to reduce the amount of time required to generate the image.
- Open a minimum of three images (which are also stored in your pa03
folder). The calls to makePicture() should assume that someone has
previously invoked setMediaPath() and thus you need not do this in your code
- Perform a minimum of one modification EACH on these images (for a
minimum of three modifications). These modifications may include
but are not limited to
- flipping
- resizing
- posterizing
- creating a negative
- creating a grayscale
- manipulating the color components (to boost or decrease a component)
- Assemble these modified images on the blank canvas to resemble the flag
of a country of your choice. While not required, I would recommend
that you select a flag with a fairly simple 2 or 3 color scheme such as
Germany, Italy, France, Russia, Sweden, Norway, South Africa, etc.
Under certain circumstances other flags can be used, but you might want to
talk with me about this.
- Modifications and copy/pasting should be written as helper methods.
Thus, the actual assembly of the flag (the generateFlag() method) may only
require a small handful of commands itself.
- Your method must return the completed collage
- I will award bonus points for students whose modifications show significant effort
or who reasonably surpass the minimum of three modifications. If
you think what you have done is worth of extra credit you should print "Please
consider this for bonus points" at the same time that you print the country of
your flag.
Deliverables
By the start of class on Wednesday, February 25th you should upload PA03.py and
all pictures required to make your flag using the homework submission system.
https://cs.uni.edu/~schafer/submit/which_course.cgi
Additionally, you should submit a paper copy of your PA03.py files.
Please make sure that your name is on this printout.