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
  • Class Hierarchies And Abstract Classes

C++ Programming

CLASS HIERARCHIES AND ABSTRACT CLASSES MCQs

Total Questions : 10

Question 1.

What does derived class does not inherit from the base class?


  1.    constructor and destructor
  2.    friends
  3.    operator = () members
  4.    all of the mentioned
 Discuss Question
Answer is Option D. -> all of the mentioned

The derived class inherit everything from the base class except the given things.

Question 2.

What should be the name of constructor?


  1.    same as object
  2.    same as member
  3.    same as class
  4.    none of the mentioned
 Discuss Question
Answer is Option C. -> same as class

None.

Question 3.

How many constructors can present in a class?


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

There can be multiple constructors of the same class, provided they have different signatures.

Question 4.

How many types of constructor are there in C++?


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

There are three types of constructor in C++. They are Default constructor, Parameterized 

constructor, Copy constructor.

Question 5.

What is meant by containership?


  1.    class contains objects of other class types as its members
  2.    class contains objects of other class types as its objects
  3.    both a & b
  4.    none of the mentioned
 Discuss Question
Answer is Option A. -> class contains objects of other class types as its members

None.

Question 6.


What is the output of this program?



1.
#include
2.
using namespace std;
3.
class poly
4.
{
5.
protected:
6.
int width, height;
7.
public:
8.
void set_values(int a, int b)
9.
{
10.
width = a; height = b;
11.
}
12.
};
13.
class Coutput
14.
{
15.
public:
16.
void output(int i);
17.
};
18.
void Coutput::output(int i)
19.
{
20.
cout
  1.    1212
  2.    1210
  3.    1010
  4.    none of the mentioned
 Discuss Question
Answer is Option B. -> 1210

In this program, We are calculating the area of rectangle and
triangle by using multilevel inheritance.
$ g++ class1.cpp
$ a.out
1210

Question 7.

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


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

There are five types of inheritance in c++. They are single, Multiple, Hierarchical, Multilevel, Hybrid.

Question 8.


What is the output of this program?



1.
#include
2.
using namespace std;
3.
class stu
4.
{
5.
protected:
6.
int rno;
7.
public:
8.
void get_no(int a)
9.
{
10.
rno = a;
11.
}
12.
void put_no(void)
13.
{
14.
}
15.
};
16.
class test:public stu
17.
{
18.
protected:
19.
float part1,part2;
20.
public:
21.
void get_mark(float x, float y)
22.
{
23.
part1 = x;
24.
part2 = y;
25.
}
26.
void put_marks()
27.
{
28.
}
29.
};
30.
class sports
31.
{
32.
protected:
33.
float score;
34.
public:
35.
void getscore(float s)
36.
{
37.
score = s;
38.
}
39.
void putscore(void)
40.
{
41.
}
42.
};
43.
class result: public test, public sports
44.
{
45.
float total;
46.
public:
47.
void display(void);
48.
};
49.
void result::display(void)
50.
{
51.
total = part1 + part2 + score;
52.
put_no();
53.
put_marks();
54.
putscore();
55.
cout
  1.    66.5
  2.    64.5
  3.    62.5
  4.    60.5
 Discuss Question
Answer is Option A. -> 66.5

In this program, We are passing the values by using different
methods and totaling the marks to get the result.
Output:
$ g++ class.cpp
$ a.out
Total Score=66.5

Question 9.

How many kinds of classes are there in c++?


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

There are two kinds of classes in c++. They are absolute class and concrete class.

Question 10.

What is meant by polymorphism?


  1.    class having many forms
  2.    class having only single form
  3.    class having two forms
  4.    none of the mentioned
 Discuss Question
Answer is Option A. -> class having many forms

Polymirphism is literally means class having many forms.

  • 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.   The Most Important Consideration In Power Amplifier Is _____....

Q.   Choose The Odd One Out.

Q.   AirAsia Group Of Which Country Has Changed The Name Of Its L....

Q.   Direction Of Twist 'Z' Is

Q.   .................. Is Your Problem?

Q.   Nyquist Plot Provides Information About Absolute Stability A....

Q.   International Women's Day Is Being Celebrated On Which Date?....

Q.   A) D

Q.   Two Students Measure A Particular Length Using The Same Inst....

Q.   Light Or Heat Is Required For Which Step In The Halogenatio....

Q.   In India, The Temperate Forest Research Centre Is In Which C....

Q.   Electrophoresis Of Histones And Myoglobin Under Non-denaturi....

Q.   The Units Of Polarization Of Dielectric Are

Q.   Choose The Alternative Which Is Closely Resembles The Water-....

Q.   The Impulse Turbine Rotor Efficiency Will Have A Maximum Val....

Q.   How Much A Month Are You Paid ?

Q.   Who Has Been Awarded The Top EU Human Rights Prize- The Sakh....

Q.   Identify The Programmable Interval Timer From The Following

Q.   In Nature, Magnesium Oxide (MgO) Is

Q.   A Person Bought Two Articles A And B For Rs.5,000. He Sold A....

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