Problem 164

Web Addresses Array

Classes are nice, but they’re even better when used with an array or arraylist.

The code provided does the same as the previous assignment, but, uses an Address array instead of one variable to store each object.

Files Needed: WebAddressesArray.java

What You Should See

1. 191 Marigold Lane, Miami, FL  33179
2. 3029 Losh Lane, Crafton, PA  15205
3. 4939 Holt Street, Lake Worth, FL  33463
4. 2693 Hannah Street, Hickory, NC  28601
5. 4880 Carter Street, Fairview Heights, IL  62208

What You Should Do on Your Own

Assignments turned in without these things will receive half credit or less.

  1. The code provided counts up to 5 in the loops instead of using the .length field of the array. Fix this.
  2. Also, the code provided makes an array that only holds five addresses, but the text file contains six. Make the array bigger, so that all six addresses are read in.

◄ 163.2: Web Addresses Scanner 165: Address .toString() ►



Adapted from ProgrammingByDoing.com
©2013 Graham Mitchell

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.