CS160 In Class Exercise
0. Form group of 5 students. Use a few pieces of paper and do the following.
Please make sure you have everyone's name written before you turn in the exercise.
1a. Develop an object model, including classes and attributes of the following
"copy machine" problem. You can make resaonable assumptions. (50 points)
- The machine copies A4 size paper only.
- If the original is too big, the machine will indicate an warning of size
mismatch.
- The machine can do either black & white or color copy.
- The price for black & white is 25 cents and color is $1.
- Users can select how many copies to be done.
- Users have to input money first before any copy can be done.
- The machine accepts only quarters. Other coins are immediately returned.
- An error message will be displayed if the money inputed is not enough.
- Quarters exceeding the cost of copying are also returned when the copy button is
pressed.
- The vending machine has two buttons, a black&white copy button and a color
copy button.
1b. Draw five scenario diagrams for 5a (25 points)
1c. Revisit problem 1a and add support for sorting and stable functions (25
points)