Arrays 2 - for


examples


Classwork

In a text document:

For each, think about input, including variable names and types; prompt the user for input.

1. Ask the user how many dogs there are. Make an array of Strings that size, then read in all the dog names from the user into the array.

2. Create a size 100 array of ints, and fill it with numbers following the pattern 0, 3, 6, 9, 12, 15, etc up to 297.

3.Assume you have a module getPriceList() that produces an array of house prices; use it to make an array. Ask the user for their budget, and go through the list, printing all the prices that are under their limit.