public : void input( ) { cout << Enter the details as donor no, name and blood group : ; “\n “ cin >> d_no ; gets ( name ); gets ( b_grp ) ; } void output( ) { cout << The details are ; “\n “ cout << Name : << name << Donor No : << d_no ; “\n “ “\n cout << Blood Group : << b_grp ; “\n “ } char * checkgroup ( ) { return ( b_grp ) ; } } ; Q4. Define a TEST in C++ with following description: Private Members TestCode of type integer Description of type string NoCandidate of type integer CenterReqd (number of centers required) of type integer A member function CALCNTR() to calculate and return the number of centers as (NoCandidates/100+1) Public Members A function SCHEDULE() to allow user to enter values for TestCode, Description, NoCandidate & call function CALCNTR() to calculate the number of Centres A function DISPTEST() to user to view the content of all the data members Ans: class TEST { int TestCode; char Description[20]; int NoCandidate,CenterReqd; void CALCNTR(); void SCHEDULE(); void DISPTEST(); }; void TEST::CALCNTR() { CenterReqd=NoCandidate/100 + 1; } void TEST::SCHEDULE() { cout<<”Test Code :”;cin>>TestCode; cout<<”Description :”;gets(Description); cout<<”Number CALCNTR(); } void TEST::DISPTEST() { cout<<”Test Code :”<<TestCode<<endl; cout<<”Description :”<<Description<<endl; cout<<”Number
public : void input( ) { cout << “\n Enter the details as donor no, name and blood group : “ ; cin >> d_no ; gets ( name ); gets ( b_grp ) ; } void output( ) { cout << “\n The details are “ ; cout << “\n Name : “ << name << “\n Donor No : << d_no ; cout << “\n Blood Group : “ << b_grp ; } char * checkgroup ( ) { return ( b_grp ) ; } } ; Q4. Define a TEST in C++ with following description: Private Members TestCode of type integer Description of type string NoCandidate of type integer CenterReqd (number of centers required) of type integer A member function CALCNTR() to calculate and return the number of centers as (NoCandidates/100+1) Public Members A function SCHEDULE() to allow user to enter values for TestCode, Description, NoCandidate & call function CALCNTR() to calculate the number of Centres A function DISPTEST() to user to view the content of all the data members Ans: class TEST { }; int TestCode; char Description[20]; int NoCandidate,CenterReqd; void CALCNTR(); void SCHEDULE(); void DISPTEST(); void TEST::CALCNTR() { CenterReqd=NoCandidate/100 + 1; } void TEST::SCHEDULE() { cout<<”Test Code :”;cin>>TestCode; cout<<”Description :”;gets(Description); cout<<”Number CALCNTR(); } void TEST::DISPTEST() { cout<<”Test Code :”<<TestCode<<endl; cout<<”Description :”<<Description<<endl; cout<<”Number
Compt%20Sci.docx