a. Create a class named BloodData that includes fields that hold a blood type (the four blood

Question:

a. Create 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 1 and –). Create 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. Create an application named TestBloodData that demonstrates each method works correctly. Save the application as TestBloodData.java. 

b. Create 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. Create an overloaded constructor that provides values for each field. Also provide get methods for each field.
Save the file as Patient.java. Create an application that demonstrates that each method works correctly, and save it as TestPatient.java.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java Programming

ISBN: 978-1337397070

9th edition

Authors: Joyce Farrell

Question Posted: