Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA coding help. Need help with this assignment. Must only use two Classes. First is the Main second is Patient. In Patient you must use
JAVA coding help. Need help with this assignment. Must only use two Classes. First is the Main second is Patient. In Patient you must use nested classes. The main is provided and may not be changed.
P9.88 Create a class named Patient that includes an ID_number, age and blood_data*. Provide a default constructor that sets the ID to "O0", the age to "O", and the BloodData to "O" and '+. Create an overloaded constructor that provides values for each field. BloodData shall be a nested class in the Patient Class. BloodData includes fields that hold a String blood-type {"O", "A", "B", or "AB') and a char RhFactor,. Create a default constructor that sets the fields to "O" and+, and an overloaded constructor that provides values for each field Simple Main Your main must only contain the following lines of code and execute with the expected output. Patient Timmy-new Patient) System.out.printin("Patient ID: "Timmy.getID0 + Timmy.displayBlood); Patient Spike new Patient(1337, 19, -, "AB") "inPatient Age:"+Timmy.getAge()) System.out.printin("Patient ID:"+Spike.getIDO+ "InPatient Age:"+Spike.getAgel); Spike.displayBlood0 Expected Output: Patient ID: 0 Patient Age: 0 Blood Type: O+ Patient ID: 1337 Patient Age: 19 Blood Type: ABStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started