The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 6 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
I am having trouble with setting up the displayAddress() and displayAddressLabel(). I have everything else, but cannot figure out how to code the formating aspects.
Create another class titled Customer under package core. It should have the following attributes and methods:
A????1 name - String
A????1 streetAddress - String
A????1 city - String
A????1 state - String
A????1 zip - String
A????1 age - int
A????1 Constructor that accepts name and address values and sets the attributes.
A????1 Gets and sets for all attributes (You donA????1t have to type up all the get and set methods. Use Eclipse to generate them automatically. Click on Source ? Generate Getters and Setters).
A????1 Method displayAddress () - returns a string that has the complete formatted address with street address, city, state, and zip (you can choose how you want to format it).
A????1 Method displayAddressLabel () - returns a string that has the CustomerA????1s name along with the complete formatted address (you can choose how you want to format it).
public class Customer
{
  String name;
  String streetAddress;
  String city;
  String state;
  String zip;
  int age;
 Â
  public Customer()
  {
    Â
  }
 Â
  public String getName() {
     return name;
  }
  public void setName(String name) {
     this.name = name;
  }
  public String getStreetAddress() {
     return streetAddress;
  }
  public void setStreetAddress(String streetAddress) {
     this.streetAddress = streetAddress;
  }
  public String getCity() {
     return city;
  }
  public void setCity(String city) {
     this.city = city;
  }
  public String getState() {
     return state;
  }
  public void setState(String state) {
     this.state = state;
  }
  public String getZip() {
     return zip;
  }
  public void setZip(String zip) {
     this.zip = zip;
  }
  public int getAge() {
     return age;
  }
  public void setAge(int age) {
     this.age = age;
}
  public void displayAddress()
  {
    Â
  }
  public void displayAddressLabel()
  {
}
}
Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- Th-----------ank----------- Yo-----------u f-----------or -----------usi-----------ng -----------our----------- we-----------bsi-----------te -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill-----------