Question
Write a full C++ program patient.cpp with a class Patient. A patient would have a name (string), an age (int) and a gender (char, M
Write a full C++ program patient.cpp with a class Patient. A patient would have a name (string), an age (int) and a gender (char, M for male, F for female, U for Unspecified). A public member function print() prints the name, age and gender in one line using the format like \"Name: John Age: 22 Gender: M\". A default constructor sets the name to \"None\", age to 0 and gender to 'U! A parameterized constructor lets the programmer create the object by specifying name, age and gender as parameters. In the main() function o create two objects one using the default constructor - another use the parameterized constructor and provide the values as shown in the sample run o call the print functions of both objects. Notes: Make it a single cpp file project with all necessary components Methods can be either inline or not inline Do not add anything not asked in the description Make empty classes, methods, and functions first and then fill in with logics to maximize the partial credits! Expected output: Name: None Age: 0 I Gender: U Name: John Age: 22 | Gender: M
Step 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