Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Make a class named BloodData that includes fields that hold a blood type (the four blood types are O, A, B, and AB) and an

Make a class named BloodData that includes fields that hold a blood type (the four blood types are O, A, B, and AB) and an Rh factor (the factors are + and -). Make a default constructor that sets the fields to O and 1, and an overloaded constructor that requires values for both fields. Include get and set methods for each field. Save this file as BloodData.java.Make an application named TestBloodData that demonstrates each method works correctly. Save the application as TestBloodData.java.

Make a class named Patient that includes an ID number, age, and BloodData. Provide a default constructor that sets the ID number to 0, the age to 0, and the BloodData values to O and 1. Make an overloaded constructor that provides values for each field. Also, provide get methods for each field. Save the file as Patient.java. Make an application that demonstrates that each method works correctly, and save it as TestPatient.java.

THE OUTPUT MUST BE:

Sample Output TestBloodData

*********************

Eight Most Common

Blood Types

*********************

The blood is A+

The blood is A-

The blood is type B+

The blood is type O+

The blood is type O-

The blood is AB+

The blood is AB-

*********************

Sample Output TestPatient

***************************************

Original Blood Type Patient 1 & 2

Patient #0 age: 0

The blood is type O+

Patient #1234 age: 35

The blood is type B+

***************************************

***************************************

Original Blood Types for Patients

Modified P1 with a new ID and Blood Type

***************************************

Patient #3456 age: 42

The blood is AB-

Patient #1234 age: 35

The blood is type B+

Patient #4567 age: 45

The blood is AB+

Patient #5678 age: 65

The blood is A-

Patient #1010 age: 38

The blood is A+

Patient #1010 age: 25

The blood is type B-

Patient #1010 age: 15

The blood is type O-

***************************************

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 Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago