|
home—lectures—recipe—exams—hws—D2L—breeze (snow day; distance)
Due:
Section 01: Sep.28 (Mon) 14:00, on D2L and hardcopy in class
Section 11: Sep.29 (Tue) 23:59, D2L.
Your submitted file should be named “hw04b.rkt”.
Standard instructions for all homeworks:
A team is:
(5pts) Give a data definition (including examples of the data, and the template for any function which processes a team), as per steps 1-3 of the design recipe. Give at least three examples of a team.
(10pts)
We'll say one team is “greater” than another if its offense is
higher than the other's defense, and its defense is higher than the other's offense.
Write the function
Hints:
Imagine a friend has two different snap-shots of the game; what is the minimal information that your friend needs to tell you so that you can always properly draw/construct an image of that object on the screen.
Do NOT include information which never changes (is “invariant”) for a class. For example, if all instances of an object are always the same color, you wouldn't have a field for the color.
See also scheme-resources—ITEC380 Racket resources.
1Note that the stub-function, step 5e, gets replaced with the real body (step 7), so it won't be visible in what you submit. Also, you don't need to include the names of constructors/selectors; that was part of hw04a but not part of the design recipe. ↩
2 Choose one of the types above which is naturally represented as a struct/object with more than one field. (That's probably all three of those answers, though conceivably not.) ↩
3 The natural constructor is the one that just initializes each field directly from its arguments. It's totally automatic; in fact tools like Eclipse offer a menu option to auto-generate the natural constructor. Just like we did for Book.java in class. ↩
home—lectures—recipe—exams—hws—D2L—breeze (snow day; distance)
©2015, Ian Barland, Radford University Last modified 2015.Sep.27 (Sun) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |