LakshyaEducation.in

VEDIC MATHS Video Series
  • Home
  • Video Series
    • Vedic Maths Videos
    • Quantitative Aptitude Videos
    • Class 8 Maths Videos
    • Class 9 Maths Videos
    • Class 10 Maths Videos
  • Quiz & Solutions
  • Blog
  • Store
  • Login
  • Contact Us
  • Home
  • Topic
  • C++ Programming
  • Design Of Class Hierarchies

C++ Programming

DESIGN OF CLASS HIERARCHIES MCQs

Total Questions : 10

Question 1.

What is the syntax of inheritance of class?


  1.    class name
  2.    class name : access specifer
  3.    class name : access specifer class name
  4.    None of the mentioned
 Discuss Question
Answer is Option C. -> class name : access specifer class name

None.

Question 2.

What does inheriatance allows you to do?


  1.    create a class
  2.    create a hierarchy of classes
  3.    access methods
  4.    None of the mentioned
 Discuss Question
Answer is Option B. -> create a hierarchy of classes

None.

Question 3.


What is the output of this program?



1.
#include
2.
using namespace std;
3.
class BaseClass
4.
{
5.
public:
6.
virtual void myFunction()
7.
{
8.
cout myFunction();
39.
return 0;
40.
}

  1.    123
  2.    12
  3.    213
  4.    321
 Discuss Question
Answer is Option A. -> 123

We are passing the objects and executing them in a certain order and we are printing the program flow.
Output:
$ g++ des3.cpp
$ a.out
123

Question 4.


What is the output of this program?



1.
#include
2.
using namespace std;
3.
class BaseClass
4.
{
5.
int x;
6.
public:
7.
void setx(int n)
8.
{
9.
x = n;
10.
}
11.
void showx()
12.
{
13.
cout
  1.    10
  2.    20
  3.    1020
  4.    None of the mentioned
 Discuss Question
Answer is Option C. -> 1020

In this program, We are passing the values from the main class and printing it on the inherited classes.
Output:
$ g++ des2.cpp
$ a.out
1020

Question 5.

Pick out the correct statement about multiple inheritance.


  1.    Deriving a class from one direct base class
  2.    Deriving a class from more than one direct base class
  3.    Deriving a class from more than one direct derived class
  4.    None of the mentioned
 Discuss Question
Answer is Option B. -> Deriving a class from more than one direct base class

In multiple inheritance, We are able to derive a class from more than one base class.

Question 6.

  1.    10
  2.    4
  3.    40
  4.    None of the mentioned
 Discuss Question
Answer is Option C. -> 40

In this program, We are multiplying the value 10 and 4 by using inheritance.
Output:
$ g++ des.cpp
$ a.out
40

Question 7.

How many types of class are there in c++?


  1.    1
  2.    2
  3.    3
  4.    4
 Discuss Question
Answer is Option C. -> 3

There are three types of classes. They are abstract base classes, concrete derived classes, 

standalone classes.

Question 8.

Pick out the correct statement about override.


  1.    Overriding refers to a derived class function that has the same name and signature as a base class virtual function.
  2.    Overriding has different names.
  3.    both a & b
  4.    None of the mentioned
 Discuss Question
Answer is Option A. -> Overriding refers to a derived class function that has the same name and signature as a base class virtual function.

None.

Question 9.

How many ways of reusing are there in class hierarchy?


  1.    1
  2.    2
  3.    3
  4.    4
 Discuss Question
Answer is Option B. -> 2

Class hierarchies promote reuse in two ways. They are code sharing and interface sharing.

Question 10.

Which interface determines how your class will be used by other program?


  1.    public
  2.    private
  3.    protected
  4.    None of the mentioned
 Discuss Question
Answer is Option A. -> public

If we invoked the interface as public means, We can access the program from other programs also.

  • Share on Facebook!
  • Share on Pinterest!

Sub Topics

  • Abstract Classes
  • Access Control
  • Argument Passing
  • Arrays
  • Booleans
  • C++ Concepts
  • Catching Exceptions
  • Character Types
  • Class Hierarchies And Abstract Classes
  • Class Hierarchies Introduction
  • Classes
  • Comments And Indentation
  • Complex Number Type
  • Constants
  • Constructors And Destructors
  • Container Design
  • Conversion Operators
  • Declaration
  • Default Arguments
  • Dereferencing
  • Derivation And Templates
  • Derived Classes
  • Design Of Class Hierarchies
  • Enumerations
  • Error Handling
  • Error Handling Alternatives
  • Essential Operators
  • Exception Specifications
  • Exceptions
  • Exceptions And Efficiency
  • Exceptions That Are Not Errors
  • Floating Point Types
  • Free Store
  • Friends
  • Function Call
  • Function Declarations
  • Function Templates
  • Functions
  • Grouping Of Exceptions
  • Header Files Usage
  • Increment And Decrement
  • Integer Types
  • Large Objects
  • Linkage
  • Macros
  • Modularization And Interfaces
  • Multiple Inheritance
  • Namespaces
  • Objects
  • Objects And Classes
  • Oops Concepts
  • Operator Functions
  • Operators
  • Overloaded Function Names
  • Pointer To Function
  • Pointer To Void
  • Pointers
  • Pointers Into Arrays
  • Pointers To Members
  • References
  • Resource Management
  • Run Time Type Information
  • Sequence Adapters
  • Sequences
  • Simple String Template
  • Sizes
  • Specialization
  • Standard Exceptions
  • Standard Library Design
  • Statements
  • String Class
  • Structures
  • Subscripting
  • Template Arguments To Specify Policy Usage
  • Types
  • Uncaught Exceptions
  • Unspecified Number Of Arguments
  • User Defined Types
  • Value Return
  • Vector
  • Void

Topics

  • Computer Aptitude
  • SAIL Junior Officer (E-0)
  • 10th Grade
  • 11th Grade
  • 12th Grade
  • 4th Grade
  • 5th Grade
  • 6th Grade
  • 7th Grade
  • 8th Grade
  • 9th Grade
  • NCERT
  • Cat
  • Commerce
  • Computer Science
  • Engineering
  • English
  • General Knowledge
  • Ias
  • Management
  • Quantitative Aptitude
  • Reasoning Aptitude
  • General Studies (Finance And Economics)
  • Analytical Instrumentation
  • Biochemistry
  • Bioinformatics
  • Biology
  • Biotechnology
  • Bitsat
  • Business Statistics
  • C Programming
  • C++ Programming
  • Cell Biology
  • Chemistry
  • Cost Accounting
  • Drug And Pharmaceutical Biotechnology
  • Electrical Measurement And Instrumentation
  • Environment Management
  • Environmental Biotechnology
  • Enzyme Technology
  • Financial Management And Financial Markets
  • Gate
  • General Science
  • Geography
  • Heat Transfer
  • History And National Movements
  • Human Anatomy And Physiology
  • Human And Cultural Diversity
  • Human Resource Management
  • Indian Economy
  • Indian Geography
  • Indian History
  • Indian Polity
  • Instrumentation Transducers
  • International Relations
  • Life Sciences
  • Marketing And Marketing Management
  • Mass Transfer
  • Mechanics Of Materials
  • Microbiology
  • Neet
  • Professional Communication
  • Renewable Energy
  • Sociology
  • Surveying
  • Total Quality Management
  • Uidai Aadhaar Supervisor Certification
  • Virology

Recent Questions

Q.   Apache Bigtop Uses ___________ For Continuous Integration T....

Q.   Corporates Have Benefited Tremendously 1)/ From The Governme....

Q.   A Little Gush Of Gratitude

Q.   Among The Following Which Layer Is Directly Apposed To The C....

Q.   Metal Chloride That Is Hydrated Is

Q.   A Steel Member Used In The Furnace Construction To Take The ....

Q.   Which Of The Following Is not Among The Advantages Of H....

Q.   He Killed The Enemy By His Sword.

Q.   Main Circuit Board In A Computer Is...

Q.   The Interpreter Of Indian Constitution Is-

Q.   Rectify

Q.   How Many 4d Orbitals Are There In An Atom?

Q.   If You Increase The Mass On An Object, Its Acceleration

Q.   Which Of The Following Is Capable Of Oxidizing Sulfur To Sul....

Q.   An....

Q.   India's First Private Sector Rocket Vikram-S, Was Developed ....

Q.   Rover Weighs Less Than Fido. Rover Weighs More Than Boomer. ....

Q.   A Cross Shaped (+) Or A Ring Involving Four Chromosomes May ....

Q.   Priming Is Needed In A __________ Pump.

Q.   Dynamic Similarity Is Said To Exist Between The Model And Th....

LakshyaEducation.in
Lakshya Education
Bhilai,Chattisgarh,India
Email: admin@lakshyaeducation.in Phone: 07893519977 (WhatsApp)

Quick Links

  • Vedic Maths
  • Quantitative Aptitude
  • Class – IX Maths
  • Class – X Maths
  • YouTube Channel
  • Maths Fast Trick
  • Blog

Our Services

  • About us
  • Privacy
  • TOS
  • Refund / Cancellation
  • Contact
  • Affiliate Program
  • Copyright © 2022 All Right Reserved | Lakshya Education     ( )
    Login / Register

    Your Account will be created automatically when you click the below Google or Facebook Login Button.
    •   Login With Facebook
    •  Login With Google
     Login With Email/Password