Answer to Question #217366 in C++ for Fairy

Question #217366

Define a class TEST in C++ with following description:Private MembersTestCode of type integerDescription of type stringNoCandidate of type integerCenterReqd (number of centers required) of type integerA 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 allow user to view the content of all the data members  


1
Expert's answer
2021-07-14T18:33:13-0400


#include <iostream>


using namespace std;


class Test{
    private:
        int MembersTestCode;
        string Description;
        int NoCandidate;
        int CenterReqd;
        int CALCNTR(){
            return (NoCandidate/100+1);
        }
    public:
        void SCHEDULE(){
            cout<<"\nEnter test code: ";
            cin>>MembersTestCode;
            cout<<"\nEnter description: ";
            cin>>Description;
            cout<<"\nEnter No of Candidates: ";
            cin>>NoCandidate;
            cout<<"\nEnter center rad: ";
            cin>>CenterReqd;
            CALCNTR();
            
        }
        void DISPTEST(){
            cout<<"\nTest code: "<<MembersTestCode;
            cout<<"\nDescription: "<<Description;
            cout<<"\nNo of Candidates: "<<NoCandidate;
            cout<<"\nCenter rad: "<<CenterReqd;
            cout<<"\nCenter:"<<CALCNTR();
        }
};
int main()
{
    Test t;
    t.SCHEDULE();
    t.DISPTEST();


    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS