| CS202 Assignments |
| [Syllabus] [Labs] [Projects] [Bulletin Board] [Class Notes] [Tools] [Grades] |
|
Project 1
Specification By Jenny Chang Dental Application
You are
hired as a software contractor to develop an application for the Dental Clinic
in The
Dental Payment Application consists of 3 parts: I.
Console II.
Database
using files III.
Graphical
User Interface For this
project, you are to implement part I of the application. This application contains the following
classes: Date,
Address, Person, Patient, Visits, and DentalApplication Details about each class: Date class Date
class consists of month, day, and year.
You will perform validation for the month and day as discussed in class. Address class Address
class consists of street address, city, state, and country. You will need to perform validation on the
city and state for this class. The city
can only have alphabets (a-z). If the
user chooses “US” for the country, the state must be a valid state. Visits class Visits
class contains the following member variables:
the date of visit of type Date, description of type String, balance due
of type double to keep track of how much the visit costs, next date for visit
of type Date, and paid amount of type double to keep track how much the patient
paid. You need to implement the
necessary set and get accessor for this class.
In addition, this class contains a single copy of the member variable
owedAmount which is calculated from the difference of balance due and paid
amount. The owedAmount value is
calculated when the paid amount is set.
Finally, override the toString method from the Object class and have it return
a formatted string with all the information in this class. Person class Person
class consists of birth date as a type of Date, first name, last name, middle
initial, address as a type of Address.
All member variables should be declared private with set and get
accessor methods. Patient class Class
Patient is a subclass of class Person. In
addition, this class contains the date of type Date when the patient was
created, phone number as a type String, emergency contact person as a type
String, emergency contact phone as a type String, array of objects of type
Visits to record the visits of the patient, a public method called
displayInformation of type String that returns a string with the information of
this patient (first name, last name, birthdate, date created, etc..), and a
public method called displayPatientVisits to display all the information in the
array of Visits objects. Note: you need to
use the method toString in the Visits class.
When you print out the object, the method toString is implicitly called. This
class offers searching capability.
Include a method called matchPatient that takes two parameters of type
String for the first name and last name.
If the first name and last name matches the one from this class, return
true. Otherwise, return false. Also, the
date creation should be automatically generated based on the computer
date. Furthermore,
include validation for the phone numbers.
Phone numbers should consist of 10 digits only. However, the user may enter a string with
dashes or parenthesis. Before you set
the phone numbers, you must strip the dashes and parenthesis and make sure the
remaining characters are digits and its length is 10. Otherwise, indicate with an error message and
set the phone to all zeros. DentalApplication class Class
DentalApplication will contain the main method for your application. In this application, you will create an array
of Patients objects. You can assume that
we will not have more than 500 patients for the clinic. Implement a static method called
searchPatient that takes two parameters first name and last name, and returns an
array of int values containing the indexes where the matching patients were
found in the array of patients objects. In
the method searchPatient, you will use the matchPatient method in the patient’s
object. Note: we return an array of
indexes because there might be more than one patient with the same first name
and last name. In the
main method, you will display the main menu for the users to choose from the
following options:
When the user
chooses to create a new patient, an instance of type Patient is created. You will then prompt the user for their first
name, last name, middle initial if any, birthdate, street name, city, state,
zip, country, phone contact, emergency contact number and emergency contact
person. When the
user chooses to search for an existing patient, ask the user to enter the first
name and last name. You will invoke the
method searchPatient. If there were more
than one patient, list the index number with the patients’ information. Then prompt the user to choose the index from
the list. Otherwise, go straight to
prompting the user with the following functions that they can perform to the
patient: Note: If
the patient owes anything, right away indicate that the patient owes the clinic
and the amount.
Clarifications: Display
patient information will display the patient information (eg. first name, last
name, etc.). Update
patient information will prompt the user for changes. First display the field to be modified with the
existing values in parenthesis. If the
user hits enter without entering anything, no changes are made. Otherwise the new value is set. Record a
visit prompt the user for the date of visit (should default to today’s date),
the description of the visit, balance due, balance paid, and automatically
calculate how much is owed and display it. Pay
balance owed will display the amount that is owed and if the patient owes
anything, it will prompt the user to enter the amount. Make sure this amount is a value >= 0. Delete
patient and all patient’s visits will set the object to null. History
will display all the patients’ visits. Go back
to main menu will display the main menu. Submission:
|