21. Worksheet A
Practice with the computer structure and helper functions.
- Write a data description for a structure “computer” that stores the memory (e.g., 4GB), used hard disk space (e.g., 104.9 GB) , and has a textual description of its location (e.g., “leftmost computer by the window”).
- Write the definition for this structure.
- Create the computer from the example above.
- Test your code by showing that the location of the computer you made is “leftmost computer by the window”.
- Design and test a function that is true when the computer has at least 4GB of memory.
- Design and test a function “empty-trash” which takes a computer and decreases the used hard disk space by 15% (producing a computer).