Design the Person and Customer UML diagram. You can draw this diagram in Word or you can do it by hand and take a picture

Your goal is to design a class named Person and a class named Customer which extends the Person class.

Person Class

Create a Person class that contains the following:

  • Class Fields: name, address, and phone number. (2 points)
  • No argument constructor that initializes the object with empty strings for name, address, and phone. (2 points)
  • 3 argument constructor that initializes the object with a name, address, and a phone number. (2 points)
  • Getter/setter methods for each of the fields. (3 points)
  • toString method that returns a string for the name, address, and phone number (2 points) (see example below):
    Name: Bob Smith
    Address: 123 Main Street, Plano, TX 75074
    Phone: 972-333-4444

Customer Class

Create a subclass of Person named Customer that contains the following:

  • A field for a customer number. (1 point)
  • A no argument constructor that initializes the object with an empty string for the name, address, phone, and customer number. (2 points)
  • A 4 argument constructor that initializes the object with a name, address, a phone number, and a customer number. (2 points)
  • Getter/setter method for the customer number field. (1 point)
  • toString method that prints the information from the Person toString as well as the customer number using the keyword super (2 points). (see example below):
    Name: Bob Smith
    Address: 123 Main Street, Plano, TX 75074
    Phone: 972-333-4444
    Customer Number: 1234-5678
  • In the main method create an array of 4 People. Make the first 2 elements People objects and the next two elements Customer objects. You do NOT need to use Scanner or JOptionPane to get input from the user for these objects, you can enter the data directly into the array. Print each object of the array by using a loop. (6 points)

UML Diagram

  • Design the Person and Customer UML diagram. You can draw this diagram in Word or you can do it by hand and take a picture. Please put this UML diagram into your project folder when submitting your work. (5 points)

Test your program several times using different input to ensure that it is working properly.

GRAB 30% OFF ON YOUR ASSIGNMENTS NOW