Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Instructions for Part 1 For part 1 you need to create four classes: Main, Person, Personlist, and PersonSet. 1 1. Write a class named Person.
Instructions for Part 1 For part 1 you need to create four classes: Main, Person, Personlist, and PersonSet. 1 1. Write a class named Person. This will be a very basic class with three attributes for storing name, height, and weight information. This class should also have a toString method that returns the Person data in a database-ready String format. 2. Write an interface named Personlist. The interface should have two abstract methods: A. add - This method takes a Person as input and returns void. B. get - This method takes an int as input and returns a Person at the corresponding index of the input int. 3. Write a class named, PersonSet, that implements the interface PersonList. For part 1, I don't want you to fill in the code of any of the Personset methods, just make a shell with placeholders. For instance, you can return null from the get method in order to make it compile. 4. In the main method in Main: A. Instantiate a single person object as a test. You can make up the data passed to the constructor. B. Instantiate a PersonSet object as a test. C. Read data in from the file hr.txt and display it on the command prompt. UML Diagram for Human Resources Part 1 > Personlist add[p: Person):void + getindex: int) : Person
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started