FUNCTIONS, CONSTRUCTOR, DESTRUCTOR & OVERLOADING QUESTIONS IN C++. (3)

Answer the questions (i) and (ii) after going through the following program:
class Student
{
int stuID;
char address[50];
float fees;
public:
Student() //Function1
{
stuID=108;
strcpy(address,"MEERUT");
fees=5400;
}
void Course(float C) //Function2
{
count<<stuID<<":"<<address<<"fees<<endl;
} //Function3
~ Student()
{
"cout<<"course Cancelled"<<endl;
}
Student(int S,char A[],float C) //Funciton4
{
stuID=S;
strcpy(address, A);
fees=C;
}
};
void main() //Line1
{ //Line2
Student S1, S2(102, "Meerut", 20); //Line3
for(int i=0; i<5; ++) //Line4
{ //Line5
S1.Course(50); //Line6
S2.Course(45); //Line7
} //Line8
}

(i) In object oriented programming, what are Function1 and Function4 combined together as?
(ii) How many times the message "Course Cancelled" will be displayed after executing the above C++ code? Out of Line1 to Line 9, which line is responsible to display the message "Course Cancelled"?


No comments

Post your comments

Powered by Blogger.