CBSE Guess > Papers > Important Questions > Class XII > 2010 > Computer Science > Computer Science By Naveen Gupta
CBSE CLASS XII
(c). Difference between Structured programming language and Object Oriented Programming Language.
(d).. How the copy constructor is different from parameterized constructor? Explain with help of example.
e. Define the terms class and object?
f. class cat
{
public:
cat(int initialAge)
{
itsAge=initialAge;
}
~cat()
{
}
int getAge()
{
return itsAge;
}
void setAge(int Age)
{
itsAge=Age;
}
void Meow()
{
cout<< “Meow\n”;
}
private:
int itsAge;
}
void main()
{
cat Friskey(5);
_____________ //Statement 1
cout<< “Friskey is a cat who is”;
cout<<_______________ << “years old\n”; //Statement 2
______________ //Statement 3
Friskey.setAge(7);
cout<< “\n Now Friskey is”;
cout<<______________ << “years old\n”; //Statement 4
}
Observe the program given above carefully and fill the blanks marked as Statement 1, Statement 2, Statement 3 and Statement 4 to produce the following output:
Meow
Friskey is a cat who is 5 years old
Meow
Now Friskey is 7 years old
Paper By Mr. Naveen Gupta
Email Id : [email protected] |