There is a more recent offering of this course. This is an archive of the
course which was offered in Winter 2016-2017.
Lab
4
Get started now
Lab 4: Interfaces
Specific instructions for Dr. Taylor's section
## Calculating Costs
Price calculations should be based on the following rules:
### Vegetables
Vegetables should be priced on a per kilogram basis.
* $20.00 per Kg for sea vegetables
* $2.00 per Kg for podded vegetables
* $1.50 per Kg for stem vegetables
* $0.30 per Kg for root vegetables
* $1.00 per Kg for all other vegetables
### Fruit
Aggregate fruits are priced at $2.30 per kilogram. All other fruits are
priced by quanity.
* $0.50 for each stone fruit
* $0.80 for each fleshy fruit
Any other fruit should be given a random per-fruit price between 10 cents
and $2.
### Milk
Skim, 1%, and 2% milk should have a price of $2.50 a gallon. The price of
half and half is double that of skim milk, and the price of cream is triple
the price of skim milk.
### Soft Drinks
The base price for soft drinks is 8 cents for each fluid ounce. The
following two scaling factors should be multiplied by the base price:
1. Container size factor: $ \frac{12N}{V} $
2. Quantity factor: $ 0.99^{N} $
Where $N$ is the number of containers and $V$ is the total volume.
The price should be rounded to the nearest ten cents.
## Extras
Answer each of the questions in the lab4.md file.
The file makes use of
Markdown formatting.
Be sure to use a text editor to edit the file (do not use Word).
The answer to the first question is provided in order to give you an
example of how to answer the remaining questions.