Answer to Question #206779 in C++ for python

Question #206779

Define a class 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 allow user to view the content of all the data members.


1
Expert's answer
2021-06-14T03:00:59-0400
#include <iostream>
#include <string>
using namespace std;
class TEST{
    int TestCode, NoCandidate, CenterReqd;
    string Description;
    int CALCNTR(){
        return NoCandidate/100+1;
    }
    public:
    TEST(){}
    void SCHEDULE(){
        cout<<"Enter test code: "; cin>>TestCode;
        cout<<"Enter description: "; cin>>Description;
        cout<<"Enter NoCandidate: "; cin>>NoCandidate;
        CenterReqd = CALCNTR();
    }
    void DISPTEST(){
        cout<<"Test Code: "<<TestCode<<endl;
        cout<<"Description: "<<Description<<endl;
        cout<<"NoCandidate: "<<NoCandidate<<endl;
        cout<<"Number of Centers required: "<<CenterReqd<<endl;
    }
};

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