CMSC 104 -- Fall 1998 -- Sections 103 and 301
Homework 3
Homework 3 is due before class on
Monday October 12, 1998 for section 103
Thursday October 8, 1998 for section 301
Late Homework will NOT be accepted and recieve a score of ZERO.
Homework 3 is worth 50 points.
Each part of question 1 is worth 5 points.
Each part of question 2 is worth 20 points
- First solve each of the problems below.
- Then write an algorithm for each of these two problems. Either English
sentences OR pseudocode is acceptable.
1. Ms. Shoe kept 2 meatballs for herself, then divided the others
equally
among her 14 children. If each child got 5 meatballs, how many did Ms.
Shoe have to begin with ?
Tips about problem #1:
- Your algorithm should allow Ms. Shoe to keep any number of
meatballs for herself. This amount should be specified by the
user.
- The user should also specify the number of children
- The user should also specify the number of meatballs
per child.
2. Ms. Match went to a store, spent half of her money and then $ 10
more. She went to a second store, spent half the money she had left
and then $ 10 more. She then had no money left. How much money did
Ms. Match have when she started out ?
Tips about problem # 2:
- Ms. Match should always have no money left at the end.
- The user should specify the number of stores.
- The user should specify the "amount more" that Ms. Match spends
at each store, but it will be the same amount at each store.