CS 1401, Quiz #11

Date: April 25, 2005
Section: (starting 9 am or starting 10:30 am) ______________________________________________________________________

Name (please type legibly, ideally in block letters): ______________________________________________________________________

1. Write down a piece of code that, given two arrays amount and unitCost of the same size, returns the overall cost of the purchase, i.e., the value cost = amount[0]*unitCost[0] + amount[1]*unitCost[1] + ...

2. Write down a method expensive that, given an array unitCost, returns the number of the items whose unit cost is above 10 dollars.