Question: (USE C# CSHARP) Create a class named Person , which contains A function named print() Two data fields i.e. personName and age A class named

(USE C# CSHARP)

Create a class named Person, which contains A function named print() Two data fields i.e. personName and age A class named Patient inherits Person class, which contains Two data fields i.e. diseaseType and recommendedMedicine Overridden function print() to display all details relevant to a patient A class named MedicarePatient inherited from class Patient, which holds A data field representing the name of the hospital A data field representing the name of the ward A data field representing room number Overridden function print() to display all details relevant to a patient. This function should be prevented from being overridden further.

There should be input/getter functions as well in each Patient and MedicarePatient classes. You have to use delegates to call the functions. No function should be called directly. No member of the Person class should be accessible in main ( ), Encapsulation should be observed strictly. Use properties of Person class data members to be accessed in derived classes, if needed. Comment your program accordingly.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!