CS135 Study Guide - Midterm Guide: End Time, Empty String, Natural Number

257 views4 pages

Document Summary

Note: these practice questions were prepared without seeing the midterm, and they do not cover everything that could be on the midterm. Completing only these questions is not suf cient preparation for the midterm: the restaurant racket king uses structures to represent information about its burgers. To avoid over lling an individual burger, the veg-count must be at most 10. (a) write a structure de nition for burger and a data de nition for burger. (b) write a template burger-template that consumes a burger. Unfortunately, racket king uses processed cheese on all of its burgers, which they do not consider to be healthy. Write a function healthy?, that consumes a burger, and produces true if that burger has at least two of the four healthy characteristics mentioned above, and false otherwise. However, for every burger in the consumed list that has zero (0) healthy characteristics, the number produced is subtracted by one (1).

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers