Day 16
- Monday is a holiday - no classes or office hours
- Final Exam: Monday, June 6, 7-10pm, building 10, room 223
- Let me know ASAP (today!) if you have a conflict
- Read Chapter 13
- Lab 8 is due next Tuesday at end of lab - handin only - no in-person demo required
- Project 5 is due next Thursday night
- Lab Quiz 3: Tuesday during lab
- Topics: arrays of structs, functions, structs as parameters and/or return types
- Example: Write a program that reads a set of menu items (name, price, calories),
then prints two menus: one with menu items below 300 calories, one with menu items
with 300 calories or more. Use structs, functions for each feature (read one item,
write low cal menu, write high cal menu), and standard input/output.
- Solution
- Example: Write a program that reads a set of pets (name, genus (e.g. cat, dog), price, age),
then prints three lists (all dogs, all cats, all snakes). Use structs and at least two
functions (one to read the data, and one to print a list where the genus is the parameter).
Use standard input/output. The input will be terminated by the end-of-file.
- Sample input and output.
- Example: Write a program that reads temperature readings (temp, month, day, year),
then prints the average temperature for each month over all years and days.
Use structs and at least two functions (one to read the data, and one to calculate
the average temperature for a given month). Use standard input/output. The input will
be terminated by the end-of-file.
- Sample input and output.
- Lecture Topics