Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions