Pair work Ch 2.1–2.2
- Due Feb 2, 2022 by 9:50am
- Points 1
- Available after Feb 2, 2022 at 9am
Problem 1
Imagine you're helping to implement an ADT to handle ordering from dinning halls on campus (Callahan, etc.). Let's call this ADT FoodOrder. Come up with five attributes or operations for this. For each one, describe what it does, and for operations also include what it's output is (if anything) and what information it needs as input (if any).
Problem 2
Adapt the flower code to draw a blue star with five points instead of a flower (the angles should sum to 1080°). Start from ch2_flower1.py in the code folder on pCloud—https://bit.ly/csc160sp22 Links to an external site..
Problem 3
Why do we need george.up() in the earthquake plotting code? See ch2_plot_earthquakes.py in the code folder on pCloud Links to an external site..
Problem 4
Suppose you have the coordinates of discovered artifacts from a 9 meter × 9 meter plot during an archaeological dig. The coordinates extend from (0,0) in the bottom left corner of the plot to (9,9) in the upper right corner. Write a program that plots a list of these coordinates to detect any patterns in their locations. Start with ch2_plot_artifacts.py in the code folder on pCloud Links to an external site.. (Havill, problem 2.2.8)
Hint: look at the earthquake plotting program (ch2_plot_earthquakes.py); note that to run that example successfully, you need to also download the oceanbottom.gif image in the same folder.