Question: Chapter 4 describes the ADT Sorted List using an array implementation with a maximum of 25 items. The pseudocode for the ADT Sorted List Operations

Chapter 4 describes the ADT Sorted List using an array implementation with a maximum of 25 items. The pseudocode for the ADT Sorted List Operations are provided on page 210. Use this information to create an ADT for handling a collection of Person objects, where each object will contain a Social Insurance Number (validate this), a first name, a last name, a gender and a data of birth. This implementation should prevent duplicate entries that is, the Social Insurance numbers must be unique.

Chapter 4 describes the ADT Sorted List using an array implementation with Write a test program (separate class) that will demonstrate the following: a) Read from a binary file: SIN (an integer), first name (a UTF string), last name (a UTF string), gender (a character), and date of birth (a java.util.Date object). You will need to create your own test data for this part and there should be at least 25 different people of which two must have the same SIN and one must be an invalid SIN. b) If the form of the SIN is not valid, an exception should be thrown with an appropriate message. Demonstrate this requirement. c) Print the list of the people (the display method must be in the test driver class and use the getSortedList() method.) [Remember that an ADT cannot return its data structure.] d) Add a 3 more unique people using user supplied input whereby the 26th item results in an PeopleException with a message like The list is full. Print the list again. e) Print the size of the SortedList, remove an item (any one), show the size has changed by printing the size again. Print the list again showing the item has been removed. f) Demonstrate the locate method works by locating an item in the list and then attempting to locate one that is not in the list.

I need full code in java.

public interface ADTSortedList> { boolean isEmpty(); int size(); void add(T item) throws SortedListException; void remove(T item) throws SortedListException; void remove(int pos) throws SortedListException; T get(int pos) throws SortedListException; int locate(T item); void removeAll(); }

Chapter 4 describes the ADT Sorted List using an array implementation with a maximum of 25 items. The pseudocode for the ADT Sorted List Operations are provided on page 210. Use this information to create an ADT for handling a collection of Person objects, where each object will contain a Social Insurance Number (validate this), a first name, a last name, a gender and a data of birth. This implementation should prevent duplicate entries - that is, the Social Insurance numbers must be unique. Write a test program (separate class) that will demonstrate the following: a) Read from a binary file: SIN (an integer), first name (a UTF string), last name (a UTF string), gender (a character), and date of birth (a java.util.Date object). You will need to create your own test data for this part - and there should be at least 25 different people of which two must have the same SIN and one must be an invalid SIN. b) If the form of the SIN is not valid, an exception should be thrown with an appropriate message. Demonstrate this requirement. c) Print the list of the people (the display method must be in the test driver class and use the getSorted List() method.) [Remember that an ADT cannot return its data structure.) d) Add a 3 more unique people using user supplied input whereby the 26th item results in an PeopleException with a message like "The list is full." Print the list again. e) Print the size of the SortedList, remove an item (any one), show the size has changed by printing the size again. Print the list again showing the item has been removed. f) Demonstrate the locate method works by locating an item in the list and then attempting to locate one that is not in the list. Chapter 4 describes the ADT Sorted List using an array implementation with a maximum of 25 items. The pseudocode for the ADT Sorted List Operations are provided on page 210. Use this information to create an ADT for handling a collection of Person objects, where each object will contain a Social Insurance Number (validate this), a first name, a last name, a gender and a data of birth. This implementation should prevent duplicate entries - that is, the Social Insurance numbers must be unique. Write a test program (separate class) that will demonstrate the following: a) Read from a binary file: SIN (an integer), first name (a UTF string), last name (a UTF string), gender (a character), and date of birth (a java.util.Date object). You will need to create your own test data for this part - and there should be at least 25 different people of which two must have the same SIN and one must be an invalid SIN. b) If the form of the SIN is not valid, an exception should be thrown with an appropriate message. Demonstrate this requirement. c) Print the list of the people (the display method must be in the test driver class and use the getSorted List() method.) [Remember that an ADT cannot return its data structure.) d) Add a 3 more unique people using user supplied input whereby the 26th item results in an PeopleException with a message like "The list is full." Print the list again. e) Print the size of the SortedList, remove an item (any one), show the size has changed by printing the size again. Print the list again showing the item has been removed. f) Demonstrate the locate method works by locating an item in the list and then attempting to locate one that is not in the list

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!