Note: This quiz has only one part as none of the questions support running code.
Fill in each blank with Model, View, or Controller:
A) The ________________ draws the app using the values in the model.
B) The ________________ contains all the data we need for the animation.
C) The ________________ responds to keyboard, mouse, timer and other events
and updates the model.
Fill in the blank with the correct answer:
A) If we _____________________ app.stepsPerSecond, the animation will appear to speed up.
B) In our grid example, getCellBounds is labeled as a __________ to __________ function,
because it takes row,col values and converts them to (x,y) values.
Fill in the blanks so that the function getCellBounds
work as defined in the notes.
def getCellBounds(app, row, col):
# returns (left, top, width, height) bounding box of given cell in grid
gridWidth = app.width - 2*app.margin
gridHeight = app.height - 2*app.margin
cellWidth = gridWidth / app.cols
cellHeight = gridHeight / app.rows
left = _____________________
top = ______________________
return (left, top, cellWidth, cellHeight)
Write an animation with the following features:
To receive credit, you must follow all MVC conventions! You must also write all helper functions you use.
Any details of the animation which aren't explicitly specified here (like the starting radius of the circles, their speed, the exact wraparound behavior of the red circle, etc) are all up to your discretion. We will accept any reasonable choice.
Note: CMU Graphics does not run in Coconut, so this question has no run button.
from cmu_graphics import *
runApp()