Based on the code below, please make a Javadocs(not generated by eclipse) that w
ID: 3812615 • Letter: B
Question
Based on the code below, please make a Javadocs(not generated by eclipse) that will describe each field and method of a class, its diffrent from pseudo code, it should be a list that's written into a word document and numbered. each method, attribute, etc should have a discription underneath it and labled by number, not comments in the code.
public class Person {
private String name;
private String address;
private String phoneNumber;
public Person(String name, String address, String phoneNumber) {
this.name = name;
this.address = address;
this.phoneNumber = phoneNumber;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
}
==============================================================
public class Customer extends Person {
private int customerNumber;
private boolean onList;
public Customer(String name, String address, String phoneNum, int number, boolean onList) {
super(name, address, phoneNum);
this.customerNumber = number;
this.onList = onList;
}
public int getCustomerNumber() {
return customerNumber;
}
public void setCustomerNumber(int customerNumber) {
this.customerNumber = customerNumber;
}
public boolean isOnList() {
return onList;
}
public void setOnList(boolean onList) {
this.onList = onList;
}
}
=====================================================
public class CustomerDemo {
public static void main(String[] args) {
Customer customer1 = new Customer("Judy Smith", "123 Maple Lane", "555-305-9876", 1, true);
Customer customer2 = new Customer("Bob White", "456 Oak Road", "555-895-4931", 2, true);
Customer customer3 = new Customer("Garry Goodman", "789 Acorn Avenue", "555-587-2983", 3, false);
System.out.println("Customer 1:");
System.out.println(" Name: " + customer1.getName());
System.out.println(" Address: " + customer1.getAddress());
System.out.println(" Phone Number: " + customer1.getPhoneNumber());
System.out.println(" Customer Number: " + customer1.getCustomerNumber());
System.out.println(" On Mailing List: " + customer1.isOnList());
System.out.println("Customer 2:");
System.out.println(" Name: " + customer2.getName());
System.out.println(" Address: " + customer2.getAddress());
System.out.println(" Phone Number: " + customer2.getPhoneNumber());
System.out.println(" Customer Number: " + customer2.getCustomerNumber());
System.out.println(" On Mailing List: " + customer2.isOnList());
System.out.println("Customer 3:");
System.out.println(" Name: " + customer3.getName());
System.out.println(" Address: " + customer3.getAddress());
System.out.println(" Phone Number: " + customer3.getPhoneNumber());
System.out.println(" Customer Number: " + customer3.getCustomerNumber());
System.out.println(" On Mailing List: " + customer3.isOnList());
}
}
Explanation / Answer
Class Name: Person
Description:
/*
*This class has the three string private attributes named as name address and phone number.
*It has a constructor which assign values to the attributes.
*It has public method to retrieve the values of it's attribute.
*getAddress method retrieves the address value of Person.
*setAddress method set the address value of Person.
*getName method retrieves the Name value of Person.
*setName method set the Name value of Person.
*getPhoneNumber method retrieves the PhoneNumber value of Person.
*setPhoneNumber method set the PhoneNumber value of Person.
*/
Method Name: getAddress
Description:
/**
*getName method retrieves the Name value of Person.
*/
Method Name: setAddress
Description:
/**
*setAddress method set the address value of Person.
*/
Method Name: getName
Description:
/**
*getName method retrieves the Name value of Person.
*/
Method Name: setName
Description:
/**
*setName method set the Name value of Person.
*/
Method Name: getPhoneNumber
Description:
/**
*getPhoneNumber method retrieves the PhoneNumber value of Person.
*/
Method Name: setPhoneNumber
Description:
/**
*setPhoneNumber method set the PhoneNumber value of Person.
*/
Class Name: Customer
Description:
/*
*This class extend to Person class.
*This class has two attribute named customerNumber and onList boolean type.
*It has a constructor which assign values to the this attributes and calls the parent Person's constructor to initialize the attributes.
*It has public method to retrieve the values of it's attribute.
*getCustomerNumber method retrieves the CustomerNumber value of Customer.
*setCustomerNumber method set the CustomerNumber value of Customer.
*getOnList method retrieves the OnList value of Customer.
*setOnList method set the OnList value of Customer.
*/
Method Name: getCustomerNumber
Description:
/**
*getCustomerNumber method retrieves the CustomerNumber value of Customer.
*/
Method Name: setCustomerNumber
Description:
/**
*setCustomerNumber method set the CustomerNumber value of Customer.
*/
Method Name: getOnList
Description:
/**
*getOnList method retrieves the OnList value of Customer.
*/
Method Name: setOnList
Description:
/**
*setOnList method set the OnList value of Customer.
*/
Class Name: CustomerDemo
Description:
/*
*This class calls the main method.
*This class creates the three object of Customer class and assign the values while creating the object.
*Then this class prints the information of all created customer on console screen.
*/
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.