Arrays 1


examples


Classwork

In a text document:

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

1. Create an array of 5 Strings and fill it with the names of  buildings on campus.  Then add code to change whichever one you spend the most time in to "HOME"

2. Create an array of ints long enough for the months of the year and fill it with the number of days for each month.   Have the program add up the days for September, October, November, and December and print the total.

3. Continuing from #2, ask the user for the month by number, and then for a date.  Check that month (remember they will give you a human number) and report whether the date they gave is possible in that month, using the array. (for example if they give you 31 that would be true for some months but false for others)