CSC 115 Assignment 2: Collections solution

$24.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (3 votes)

Objectives: Upon completion of this assignment you need to be able to:
• Practice creating a class that implements an interface in Java.
• Use the Node class to create a reference-based list.
• Use Exception Handling techniques.
• Read and understand specifications.
• Implement testing of code during development.
______________________________________________________________________________
Resources:
• CSC 115 Java Coding Conventions.pdf (found on conneX, under Resources)
• Textbook Chapters 4 and 5.
• List.java
• MedicationNode.java
• ListIndexOutOfBoundsException.java
• MedListArrayBased.java
• MedListTester.java
Introduction:
A local pharmacy would like to keep a small database of its clients and a list of the medications
that each patient is currently taking. For now, it is confined to local residents, but the pharmacy
is hoping to tap into the larger region and include communication with the hospitals. We are
tasked with supporting a basic system that will monitor medication lists to later attach to patient
files. Since most people are not on huge numbers of mediation, we decide to use the basic List
ADT to manage each patient’s medication information. We haven’t decided whether to use an
array based list or a reference based list, so we will implement both. That way we can plug in
whichever one suits the client’s needs, without having to alter the client’s handling of the lists.
The array-based medication list has already been completed and tested. We need to complete the
reference-based list.
In this assignment you will:
• Develop the MedListRefBased class that implements the standard List interface
approved by the client.
• Use the doubly-linked list as the primary data field in this class; it is described in the
textbook’s Chapter 5 beginning on page 280.
Quick Start:
1) If you haven’t done so already, download all the necessary documents for this assignment
from conneX into a specific folder for CSC115 assignment two, assn2 is a
recommended name.
2) Double-click on the List.html to see the specifications for a standard List interface. It
is similar to the ADT description on the Text page 204. The List.java file contains
all the method headers required of any class that implements a list. Note that none of the
methods contain a body; the implementation is never part of an ADT. Note also that the
description uses Java generics, described on page 291. This allows the developer of a
List to make the decision of the type of elements E that will be stored in the list.
3) Examine the completed source code for the MedListArrayBased class. Note that it
implements List