The material you need to know to complete this homework assignment will be covered in class on Thursday, Aug. 30
Your solutions to the following problems should use helper functions in place of repeated code. You may also introduce helper functions to improve the readability of your code.
Remember to include a contract, purpose, and test cases for every function you write.
suitable-for-children?
which consumes
a film and returns true if the rating of the film
is G, PG, or PG-13, and returns
false otherwise.
difference-in-receipts
. The program consumes two films and
produces a number. The number produced is the difference between the
box office receipts for the two films (the result should be a non-negative
number).
modify-rating
which consumes a film and
a symbol, and produces a film. The film that is produced is the same as the
original except that the film's rating has been replaced by the given rating.
(Your function may consume a film and a string instead of a film and a
symbol, if you chose to represent
the rating as a string.)
opens-before?
, which consumes a film and
a date, and produces a boolean. The function produces true if the given
film opens before the given date, and returns false otherwise.
Using web-based turnin, turn in a single file containing all code and documentation for this assignment. Follow the naming conventions for homework files. In addition, BOTH partners' names and wpi ccc usernames MUST be listed in a comment at the top of your file (you will lose points if these rules are not followed). Programs are due at 5pm on Tuesday, September 4. Late programs will be accepted until 5pm on Wednesday, September 5. Programs will not be accepted for submission after 5pm on Wednesday, September 5. No exceptions.