JAVA.

 

 

 

Create a program that has an object type of Contact. This contact will need to have the following attributes: Name, Birth Date, Phone Number, Address and Eye Color

 

You should write a simple program that prompts the user to create 2 new contacts. Once the contacts are created you need to print out their information in a readable manner (completely up to you – but all traits must be displayed).

 

Finally, we need to prompt the user for a new name of the first contact. Once the new name is entered you need to print out the 2 contacts again (the first contacts name should be changed)

 

 

 

Here is what I have so far not sure if its correct:

 

 

 

public class Contact{
private String name;
private String phoneNumber;
private String birthDate;
private String address;
private String eyeColor;

public String getName() {
return name;
}

public void setName(String newName) {
name = newName;
}

public String getPhoneNumber() {
return phoneNumber;
}

public void setPhoneNumber(String newPhoneNumber) {
phoneNumber = newPhoneNumber;
}

public String getBirthDate() {
return birthDate;
}

public void setBirthDate(String newBirthDate) {
birthDate = newBirthDate;
}

public String getAddress() {
return address;
}

public void setAddress(String newAddress) {
address = newAddress;
}

public String getEyeColor() {
return eyeColor;
}

public void setEyeColor(String newEyeColor) {
eyeColor = newEyeColor;
}
}

 

 

    • 12 years ago
    complete solution A++
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      testcontacts.java