Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is written in Java. Please help complete the code for these methods. It is

ID: 3678576 • Letter: T

Question

This is written in Java. Please help complete the code for these methods. It is alright to put these programs in eclipse. It would be very helpful to add comments to the code.

addrline2 means Address Line 2

zip means the zip code

SSN is Social Security Number

-----------------------

Address.java

-----------------------

package ex2;

public class Address

{

      private String number;

      private String street;

      private String addrline2;

      private String city;

      private String state;

      private String zip;

      public Address()

      {

      }

      public boolean setNumber(String s)

      {

      }

      public String getNumber()

      {

      }

      public boolean setStreet(String s)

      {

      }

      public String getStreet()

      {

      }

      public boolean setAddrline2(String s)

      {

      }

      public String getAddrline2()

      {

      }

      public boolean setCity(String s)

      {

      }

      public String getCity(String s)

      {

      }

      public boolean setState(String s)

      {

            //convert to 2 letter USPS standard

      }

      public String getState()

      {

      }

      public boolean setZip(String s)

      {

            //determine if string is 5 char or 9 char zip

            //validate

      }

      public String getZip()

      {

      }

}

--------------------------

Person.java

-------------------------

package ex2;

public class Person

{

      private String name;

      private String SSN;// Social Security Number

      private double height;

      private Address whereLives;

      public Person()

      {

      }

      public boolean setName(String s)

      {

      }

      public String getName()

      {

      }

      public boolean setSSN(String s)

      {

            // validate

      }

      public String getSSN()

      {

      }

      public boolean setHeight(String s)

      {

            // validate

      }

      public String getHeight()

      {

      }

      public boolean setWhereLives(String s)

      {

      }

      public Address getWhereLives()

      {

      }

}

Explanation / Answer

package ex2;

/**
* @author
*
*/
public class Address {
   private String number;
   private String street;
   private String addrline2;
   private String city;
   private String state;
   private String zip;

   /**
   * default constructor
   */
   public Address() {
   }

   /**
   * @return the number
   */
   public String getNumber() {
       return number;
   }

   /**
   * @return the street
   */
   public String getStreet() {
       return street;
   }

   /**
   * @return the Address Line 2
   */
   public String getAddrline2() {
       return addrline2;
   }

   /**
   * @return the city
   */
   public String getCity() {
       return city;
   }

   /**
   * @return the state
   */
   public String getState() {
       return state;
   }

   /**
   * @return the zip code
   */
   public String getZip() {
       return zip;
   }

   /**
   * @param number
   * the number to set
   */
   public boolean setNumber(String number) {
       this.number = number;
       return true;
   }

   /**
   * @param street
   * the street to set
   */
   public boolean setStreet(String street) {
       this.street = street;
       return true;
   }

   /**
   * @param addrline2
   * the Address Line 2 to set
   */
   public boolean setAddrline2(String addrline2) {
       this.addrline2 = addrline2;
       return true;
   }

   /**
   * @param city
   * the city to set
   */
   public boolean setCity(String city) {
       this.city = city;
       return true;
   }

   /**
   * @param state
   * the state to set
   */
   public boolean setState(String state) {
       this.state = state;
       return true;
   }

   /**
   * @param zip
   * the zip code to set
   */
   public boolean setZip(String zip) {
       this.zip = zip;
       return true;
   }

}

package ex2;

/**
* @author
*
*/
public class Person {
   private String name;
   private String SSN;// Social Security Number
   private double height;
   private Address whereLives;

   /**
   * default constructor
   */
   public Person() {
   }

   /**
   * @return the name
   */
   public String getName() {
       return name;
   }

   /**
   * @return the Social Security Number(sSN)
   */
   public String getSSN() {
       return SSN;
   }

   /**
   * @return the height
   */
   public double getHeight() {
       return height;
   }

   /**
   * @return the whereLives
   */
   public Address getWhereLives() {
       return whereLives;
   }

   /**
   * @param name
   * the name to set
   */
   public boolean setName(String name) {
       this.name = name;
       return true;
   }

   /**
   * @param sSN
   * the Social Security Number(sSN) to set
   */
   public boolean setSSN(String sSN) {
       SSN = sSN;
       return true;
   }

   /**
   * @param height
   * the height to set
   */
   public boolean setHeight(double height) {
       this.height = height;
       return true;
   }

   /**
   * @param whereLives
   * the whereLives to set
   */
   public boolean setWhereLives(Address whereLives) {
       this.whereLives = whereLives;
       return true;
   }

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote