Answered step by step
Verified Expert Solution
Link Copied!

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. image text in transcribed

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: AB

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

60 Workplace safety risks.

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago