Question: You are tasked with creating a C + + program to simulate a Healthcare System. In this system, each Person has private medical information, such

You are tasked with creating a C++ program to simulate a Healthcare System. In this system, each Person has private medical information, such as their medical history and insurance details, which should not be exposed to the general public. However, a Doctor class must have access to this private information in order to make informed medical decisions and provide care.
In this scenario:
-The Person class contains private attributes such as name,age,medicalHistory, and insuranceDetails.The Doctor class should have access to these private attributes to view and update the medical history for diagnosis purposes.Design a solution where the Doctor class is a friend class of the Person class, allowing it to access the private medical information of the person.The Doctor class also has private members of docName and specialization.
Requirements:
1. Implement the Person class with private member variables.
2. Make the Doctor class a friend of the Person class.
3. Create constructors for all members for both classes.
4. The Doctor class should be able to view and update the medical history of the person.
5. In the `main` function, create a Person object and a Doctor object.
6. Simulate the doctor viewing and updating the person's medical history.

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 Programming Questions!