Question: Open the file BloodData.java that includes fields that hold a blood type (the four blood types are O, A, B, and AB) and an Rh
Open the file BloodData.java 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 ). Create a default constructor that sets the fields to O and +, and an overloaded constructor that requires values for both fields. Include get and set methods for each field. Open the file TestBloodData.java and click the "Run Code" button to demonstrate that each method works correctly.
I'm experiencing issues everytime I try to compile. I am attaching a picture of my code from BloodData.java. I need help figuring out where I have gone wrong. 
BloodDatajavaPatient.java TestBloodData.java TestPatient.java 1 public class BloodData 3/ declare private variables here 4 private String bloodType; 5 private String rhFactor; 6 7 public BloodData() // add default constructor values here bloodType"O"; 10 rhFactor"+"; 13 public BloodData(String bType, String rh) // add constructor logic here bloodTypebType; 15 16 17 18 19 20 public void setBloodType(String bType) 21 // add method code here this.bloodType bType; 23 25 public String getBloodType) 26 27 28 29 30 public void setRhFactor (String rh) // add method code here return bloodType; // add method code here this .rhFactor = rh; public String getRhFactor() 35 36 37 38 39 40 // add method code here return rhFactor
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
