Question: Java Eclipse Coding question: Use data abstraction (real-world modeling) to come up with 3 instance variables and 2 effectors for a new data type the
Java Eclipse Coding question:
Use data abstraction (real-world modeling) to come up with 3 instance variables and 2 effectors for a new data type the class HospitalPatient. You have the freedom to design the instance variables and effectors.
instance variables effectors
1. 1.
2. 2.
3.
Write the code for class HospitalPatient, according to the requirement above. Include the default constructors with no argument, and the constructor with all arguments. Provide a getter and setter for each individual instance variable. Provide the two effectors that you design above. All instance data are private and all methods are public. Observe the coding conventions, including proper indent. No user input is needed.
Write the code for an application class that has a main method, and in the main method, creates two instances of class HospitalPatient, one with default constructor and one with the other constructor. Then as use to input necessary variables, and then use the setters to set the input variables into the object that you created with default constructor. Then call the effectors of the HospitalPatient and prints out some information about the patients. You can name the class JohnDoeTest, where JohnDoe should be replaced with your name. Observe coding conventions, including proper indent. You can use Scanner class here to get input parameters from user, in order to initialize the object created by the default constructor (the constructor that has no parameter). Only in this application class, you need to obtain user input.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
