Please answer the following in commented C++ code.
code:
#include<iostream>
#include<cstdio>
using namespace std;
class Patient{
private:
long patientID;
string name;
char gender;
string birthDate;
public:
Patient(long id, string name, char gender, string date){
this->patientID = id;
this->name = name;
this->gender = gender;
this->birthDate = date;
}
void printdata(){
printf("%-10ld %-20s %-13s %-5c\n",patientID,name.c_str(), birthDate.c_str(), gender);
}
};
int main(){
Patient *p1 = new Patient(10023,"Joe Garcia", 'M', "11/10/1979");
Patient *p2 = new Patient(10024, "Suzy Walter", 'F', "01/01/2010");
Patient *p3 = new Patient(10025, "Amelia Perez", 'F', "12/05/1983");
Patient *p4 = new Patient(10026, "Tim Ducrest", 'M', "01/12/2000");
Patient *patient[4] = {p1,p2,p3,p4};
printf("%-10s %-20s %-13s %-9s\n", "ID", "Name", "Birth Date", "Gender");
for(int i=0;i<50;i++)
cout<<"-";
cout<<"\n";
p1->printdata();
p2->printdata();
p3->printdata();
p4->printdata();
return 0;
}
output:
Please answer the following in commented C++ code. The purpose of this problem is to practice...