Homework 30

Construct a C++ struct that models something found in your room in Bancroft.For example, it could be your desk, which might collect together the number of drawers in it, the number of legs, and the capacity of weight it can hold (donít stress test your desk to see what load it can take!). See details below.


Turn in:

1.      A paper copy of your C++ source code representing your struct, and a function printMyStruct() that prints out all the data inside your struct (e.g., for a desk, the number of drawers, legs, etc.). Include a screenshot that shows your struct and printMyStruct() function having being successfully compiled (some kind of main() function that actually uses this function is good practice but not required), and

2.      A discussion of what error you get if you forget to end the struct definition with a semi-colon.