SUPERSTARWEBTECH

There is no elevator to success. You have to take the stairs. Take your first steps with SSWT!

CS304-Object Oriented Programming Quiz MCQs Lecture 23-45 Finalterm Objective Questions

CS304-OOP Quiz  MCQS #Objective #Questions #Finalterm

1. A class or class template can have member ___ that are themselves templates.

  • variable
  • function
  • objects
  • none

2. Select the correct line of code for composition relationship between “Keyboard” class and “Keys” class

  • class keyboard{Keys type;};
  • class keys{KeyBoard type;};
  • class keyboard : private keys
  • class keys: private KeyBoard

3. “A fan has wings”. Which type of relationship exists between fan and wings?

  • Aggregation
  • Association
  • Composition
  • Inheritance

4. Consider the following two lines of code written for a class Student,
1. Student sobj1;
2. Student sobj2(sobj1);
In line No. 2 what constructor of Student class will be called,

  • Default constructor
  • Copy constructor
  • Both Default and Copy
  • No constructor will be called

5. Consider the following two lines of code written for a class Student,
1. Student sobj1;
2. Student sobj2=sobj1;
In line No. 2 what constructor of student class will be called,

  • Default constructor
  • Copy constructor
  • Both Default and Copy constructor
  • None

6. Which of the following function can convert a class into an abstract class?

  • Abstract function
  • Concrete function
  • Virtual function
  • Pure virtual function

7. A class with no pure virtual function is a ___ class.

  • Concrete
  • Abstract
  • Virtual
  • None

8. Select the correct line of code for composition relationship between “Person” class and “Nationality” class.

  • class Nationality {Person p};
  • class Person {Nationality c};
  • class Person: private Nationality
  •  class Nationality: private Person

9.

10.

Author

Anam Afzal

Anam Afzal

Hi, I'm a Pakistani freelancer with a passion for helping businesses achieve their online goals through no-code solutions. I specialize in WordPress customization and ManyChat automation, and I'm always on the lookout for new ways to use technology to make businesses more efficient and successful. I'm also a big believer in the power of no-code tools to democratize technology and make it accessible to everyone. I'm passionate about sharing my knowledge and helping others learn how to use no-code tools to create their own websites, automate their workflows, and grow their businesses. If you're looking for a reliable and experienced no-code developer, I'm here to help. Please feel free to contact me to discuss your project requirements.
SHARE THIS POST