My Report

Object Oriented Programming Mock Test 3


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement
 10%

Question 1 of 10

1. Can local class members access/use the general local variables (except static, abstract etc.) of the function in which it is defined?

Question 1 of 10

Question 2 of 10

2. Which member function doesn’t require any return type?

Question 2 of 10

Question 3 of 10

3. What is the output of following code?

int n=10;		// global
class A()
{
	private : int n;
	public : int m;
	A()
	{ 
		n=100; m=50;
	}
void disp()
{
	cout<<”n”<<m<<n;
};

Question 3 of 10

Question 4 of 10

4. A member function can _______________ of the same class.

Question 4 of 10

Question 5 of 10

5. Which access specifier is usually used for data members of a class?

Question 5 of 10

Question 6 of 10

6. Which member will never be used from the following class?

class A()
{ 
	int marks; char name[20];
	public : A()
	{ 
		marks=100; 
	}
	void disp()
	{ 
		cout<<”Marks= ”&lt'<marks;
		cout<<”Student”;
	}
};

Question 6 of 10

Question 7 of 10

7. Which access specifier should be used so that all the parent class members can be inherited and accessed from outside the class?

Question 7 of 10

Question 8 of 10

8. What are inline member functions?

Question 8 of 10

Question 9 of 10

9. If class A has add() function with protected access, and few other members in public. Then class B inherits class A privately. Will the user will not be able to call _________ from the object of class B.

Question 9 of 10

Question 10 of 10

10. Which among the following have least security according to the access permissions allowed?

Question 10 of 10


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.