Page 1 of 1

Chapter 10 Assignment (Person and Customer Classes) - 30 points Your goal is to design a class named Person and a class

Posted: Thu May 05, 2022 12:41 pm
by answerhappygod
Chapter 10 Assignment Person And Customer Classes 30 Points Your Goal Is To Design A Class Named Person And A Class 1
Chapter 10 Assignment Person And Customer Classes 30 Points Your Goal Is To Design A Class Named Person And A Class 1 (100.43 KiB) Viewed 38 times
In Java please
Chapter 10 Assignment (Person and Customer Classes) - 30 points Your goal is to design a class named Person and a class named Customer which extends the Person class. ● Create a class named Person the contains the following: . 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 retums 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 • 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 (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) • 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)