Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Edit question It is a java program Assignment overview In this assignment, you will implement a set of related classes of objects: Patient: A patient

Edit question It is a java program

Assignment overview

In this assignment, you will implement a set of related classes of objects:

Patient: A patient hoping to receive a vaccination

HealthID: A class that represents and provides health identification numbers for patients

VaccineClinic: A clinic that receives vaccine doses, books patients and administers vaccines.

ProvincialCoordinator: Coordinates the vaccination process by distributing doses to registered clinics, and providing statistics on vaccinations to date.

Keep all of your methods short and simple. In a properly-written object-oriented program, the work is distributed among many small methods, which call each other. There are no methods in this entire assignment that should require more than 12 lines of code, not counting comments, blank lines, or {} lines (and many of them need no more than 3).

Unless specified otherwise, all instance variables must be private, and all methods should be public. Also unless specified otherwise, there should be no println statements in your classes. Objects usually do not print anything, they only return String values from toString methods. The only exception in this assignment is displayPatientsWaiting() in VaccineClinic (Phase 2).

Testing Your Code

We have provided sample test files for each phase to help you verify that your code is working to the assignment specifications (e.g., correct method headers). These files are only starting points for testing your code. Part of developing your skills as a programmer is to think through additional important test cases and to write your own code to test these cases. The test files should give you a sense what this additional code could consist of.

Phase 1: Patient and HealthID

First, implement two simple classes: a Patient class and a HealthID class

The Patient class should have:

Four instance variables: the patients name (a String), their age (an int), their health ID (a HeathID see below) and a variable indicating whether or not they have been vaccinated (a boolean).

COMP 1020 Winter 2021

A constructor that has three parameters (String, int, HealthID), which are used to initialize the first three instance variables described above. A newly instantiated patient has not yet been vaccinated.

A standard toString() method, which returns a String containing the patients name, age, health ID and vaccine status. Format this string as shown in the output below.

An equals method that checks if two patients are equal. Two patients are equal if they have the same health ID.

Three accessor methods: isVaccinated() which returns the patients vaccination status, getHealthID()

which returns the patient HealthID and getName() which returns the patients name.

A void method vaccinate() which sets the patients vaccination status to true.

We will use the convention in Manitoba, where a health ID consists of a family number and a pin. Members of the same family will have the same family number, but each individual will have a unique pin. With this in mind, the HealthID class should have:

Two instance variables: the family number (an int) and the pin (an int).

Two class variables that represent the next family number (an int) and the next pin (an int) available. The family number should start at 1000 and the pin should start at 100000000. Each should be increased by 1 when used to initialize a new HealthID instance.

A constructor with no parameters, that initializes both instance variables using the next available family number and next available pin, respectively.

A constructor that accepts a single int, which is used to initialize the instances family number. The constructor should use the next available pin to initialize the other instance variable.

Two accessor methods getFamilyNumber() and getPIN() that return the val

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_2

Step: 3

blur-text-image_3

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 Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

What is paper chromatography?

Answered: 1 week ago

Question

Explain the cost of capital.

Answered: 1 week ago

Question

Define capital structure.

Answered: 1 week ago