Problem 163.2

Web Addresses Scanner

As an addon to the prevoius question, let’s ue the same concept of using an Address class but this time, we will read in values from a file hoseted on the web.

Files Needed: WebAddressesScan.java I have created a text file with some fake addresses. This file contains six addresses.

The code provided will create a class called “Address” that contains four fields:

a field for the house number / street name (a String) a field for the city name (a String) a field for the state (a String) a field for the zip code (an int)

Then, the code provided creates a variable of type Address and reads the values from the first address in the text file into the four fields of the object.

What You Should See

191 Marigold Lane, Miami, FL  33179

What You Should Do on Your Own

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

  1. The code provided only creates one Address variable and stores one Address object in it. Change the code to read and display all six addresses from the file.

◄ 163.1: Web Addresses 164: Web Addresses Array ►



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.