Question
I need help with adding comments to my code and I need a uml diagram for it. PLs help.... Zipcodeproject.java package zipcodesproject; import java.util.Scanner; import
I need help with adding comments to my code and I need a uml diagram for it. PLs help....
Zipcodeproject.java
package zipcodesproject; import java.util.Scanner; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException;
public class Zipcodesproject {
/** * @param args the command line arguments */ public static void main(String[] args) { Scanner input=new Scanner(System.in); BufferedReader reader; int code; String state,town; ziplist listOFCodes=new ziplist(); try { reader = new BufferedReader(new FileReader("C:UsersJayDesktopzipcodes.txt")); String line = reader.readLine(); while (line != null) { code=Integer.parseInt(line); line = reader.readLine(); town=line; line = reader.readLine(); state=line; line = reader.readLine(); listOFCodes.addTOList(new zipcodes(code,town,state)); } reader.close(); } catch (IOException e) { e.printStackTrace(); } while(true) { System.out.print("Enter zipcode to find or -1 to exit: "); code=input.nextInt(); if(code==-1) break; else { listOFCodes.searchZipCode(code); System.out.print(" "); } } } } zipcodes.java
package zipcodesproject;
public class zipcodes { private int zipcode; private String town,state;
public zipcodes() { }
public zipcodes(int zipcode, String town, String state) { this.zipcode = zipcode; this.town = town; this.state = state; }
public void setZipcode(int zipcode) { this.zipcode = zipcode; }
public void setTown(String town) { this.town = town; }
public void setState(String state) { this.state = state; }
public int getZipcode() { return zipcode; }
public String getTown() { return town; }
public String getState() { return state; }
@Override public String toString() { return "Zipcode=" + zipcode + ", Town=" + town + ", State=" + state ; } } ziplist.java
package zipcodesproject;
import java.util.ArrayList;
public class ziplist { private ArrayList
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started