CS 2401 Quiz #1

Date: Tuesday, September 1, 2009.

1. Let an array price[i] contain the price of lunch of the restaurant around campus, and let name[i] contains the names of these restaurants. Write down a piece of code that prints the name of the restaurant that provides the cheapest lunch. Trace this code on an example of 3 fictitious restaurants McTacos, Burger Bell, and Miners Cafe, with lunches costing $4.05, $3.80, and $4.86.

Turn over, please.

2. Please answer questions about the reading assignment:

2a. can an array be 2-dimensional?

2b. can an array be 3-dimensional?

2c. is it possible to have a 2-dimensional array with rows of different size?