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. Write the program in java using the interface

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();

}

the page210 has method headers as described in the interface above

the person is not a class. it is an object which consists of SIN no, first and last names, gender and date of birth and we need to create a class to store this person object which could be read from the file back after saving it.

Social Insurance number is supposed to be validated by Luhn's Algorithm and is 9 digits long.

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!