Home Assignment - 3: Topic: Constructor & Destructor
Home Assignment - 3: Topic: Constructor & Destructor
CHALLENGING QUESTION
LAB 3.1 Define a class Candidate in C++ with the following descriptions:
Private Members:
RNo of type long
Name of type string
Score of type float
Remarks of type string
A function AssignRem( ) to assign Remarks as per the Score obtained by a candidate. Score range
and the respective Remarks are shown as follows:
SCORE REMARKS
>=50 Selected
Less than 50 Not selected
Public Members:
A function Enter( ) to allow user to enter values for RNo, Name, Score and call function
AssignRem() to assign the Remarks.
A function DISPLAY( ) to view the content of all the data members.
A function Return_Score() to return the score
Now write main function to do the following:
i) To create an array of 5 candidates
ii) To obtain values of the data members of all candidates by calling Enter() function repeatedly
iii) To show details of all the data members by calling Display() function repeatedly
iv) To display the details of the candidates who were selected. (Add appropriate function in the
class)
v) To display the details of a candidate whose name is entered by the user. (Add appropriate
function in the class)