Describe the Data types Supported by C++. |
|
University | Amity blog |
Service Type | Assignment |
Course | |
Semester | |
Short Name or Subject Code | SUB-Introduction to Object-Oriented Programming and C++ |
Product | of Assignment (Amity blog) |
Pattern | Section A,B,C Wise |
Price | Click to view price |
SUB-Introduction to Object-Oriented Programming and C++
SECTION A
S.NO Questions
1 (a) Describe the data types supported by C++.
(b) Write a program to arrange the given set of numbers in ascending order using a pointer.
2. What is the structure in C++? Why we use structure? Write a program by using a structure
3. (a) Explain the loop structures available in C++. Solve by www.solvezone.in
(b) Write a program to print prime numbers between two limits
4 (a) Explain the different types of inheritance supported by C++.
(b) When do you use a virtual function? Explain with suitable example
5 (a) What is Compile time polymorphism? Explain with an example
(b) Write a program to perform complex number arithmetic operations using operator overloading
6 (a) Explain the use of pointers in C++.
(b) Create a class MAT of size m x n. Define all possible matrix operations for MAT type objects
7 (a) What is a friend function? What are the merits and demerit of using friend function?
(b) Explain the different types of constructors in C++
8 (a) Describe the basic concepts of object-oriented programming
(b) Illustrate with an example, how the endl and setw manipulator works?
SECTION B
Write a program in C++ to count the number of words in a line of text
How will you transfer values from derived class constructor to base class constructor? Explain with suitable illustration
SECTION C
A function that is called automatically each time an object is destroyed is a *
(A): Destructor
(B): Destroyer
(C): Remover
(D): Terminator
which function is a non-member function that has full access to private member of a class?
(A): friend fnction
(B): inline function
(C): virtual function
(D): static function
What is default scope for a structure ?
(A): Private
(B): Protected
(C): Public
(D): None of aobve
Which one of the following is not a valid reserved keyword in C++
(A): Explicit
(B): Public
(C): Implicit
(D): Private
What punctuation ends most lines of C++ code?
(A): . (dot)
(B): ; (semi-colon)
(C): : (colon)
(D): ' (single quote)
Constructors __________ to allow different approaches of object construction.
(A): cannot overloaded
(B): can be overloaded
(C): can be called
(D): can be nested
In C++ Functions can returns ?
(A): arrays
(B): reference
(C): objects
(D): all of above
A class having no public constructors is
(A): A public protected class
(B): A public class
(C): A protected class
(D): A private class
When one class inherits from the base class, then the original class is called ?
(A): derived class
(B): base class
(C): sub class
(D): basic class
&& means ?
(A): Logical OR
(B): Bitwise OR
(C): Logical AND
(D): Bitwise AND
Which operators can not be overloaded ?
(A): Binary operator
(B): Ternary operator
(C): Unary operator
(D): All can be overloaded
Data members and member functions are enclosed within ?
(A): union
(B): structure
(C): class
(D): array
Which of following valid option will not return a value in c++ ?
(A): void
(B): free
(C): empty
(D): null
Size of a char is ?
(A): 1
(B): 2
(C): 3
(D): 4
Which is more memory efficient ?
(A): structure
(B): union
(C): both use same memory
(D): depends on a programm
It is possible to declare as a friend
(A): A member function
(B): A global function
(C): A class
(D): All of the above
Question
A C++ program statements can be commented using
(A): Single line comment
(B): Multi line comment
(C): Either (a) or (b)
(D): Both (a) and (b).
A user defined header file is included by following statement in general.
(A): #include “file.h”
(B): #include
(C): #include
(D): #include file.h
Which of the following is not the keyword in C++?
(A): volatile
(B): friend
(C): extends
(D): this
Designer of C++ programming language. Solve by www.solvezone.in contact for more details at 8882309876.
(A): Charles Babbage
(B): Dennis Ritchie
(C): Brain Kernighan
(D): Bjarne Stroustrup
An exception is __
(A): Runtime error
(B): Compile time error
(C): Logical error
(D): None of the above
Which is the storage specifier used to modify the member variable even though the class object is a constant object?
(A): auto
(B): register
(C): static
(D): mutable
SAVE & NEXT
When the compiler cannot differentiate between two overloaded constructors, they are called
(A): Overloaded
(B): Destructed
(C): Ambiguous
(D): Dubious
Runtime polymorphism is achieved by
(A): friend function
(B): virtual function
(C): Operator overloading
(D): function overloading
What will be the output of following program? #include void main() { float x; x=(float)9/2; cout<<="" td="" style="box-sizing: border-box;">
(A): 4.5
(B): 4.1
(C): 4
(D): 5
Constructors __________ to allow different approaches of object construction.
(A): cannot overloaded
(B): can be overloaded
(C): can be called
(D): can be nested
Destructor has the same name as the constructor and it is preceded by ?
(A): ?
(B): $
(C): ~
(D): !
Which of the following access specifier is used as a default in a class definition?
(A): protected
(B): public
(C): private
(D): friend
Which of the following operators cannot be overloaded?
(A): []
(B): ->
(C): ?:
(D): *
Which of the following is a mechanism of static polymorphism?
(A): Operator overloading
(B): Function overloading
(C): Templates
(D): All of the above
Which of the following ways are legal to access a class data member using this pointer?
(A): this->x
(B): this.x
(C): *this.x
(D): *this-x
Which of the following functions are performed by a constructor?
(A): Construct a new class
(B): Construct a new object
(C): Construct a new function
(D): Initialize objects
Which of the following cannot be used with the keyword virtual?
(A): class
(B): member functions
(C): constructor
(D): destructor
Which of the following concept of oops allows compiler to insert arguments in a function call if it is not specified?
(A): Call by value
(B): Call by reference
(C): Default arguments
(D): Call by pointer
Which of the following term is used for a function defined inside a class?
(A): Member Variable
(B): Member function
(C): Class function
(D): Classic function
Which of the following concepts means determining at runtime what method to invoke?
(A): Data hiding
(B): Dynamic Typing
(C): Dynamic binding
(D): Dynamic loading
Which of the following is not the member of class?
(A): Static function
(B): Friend function
(C): Const function
(D): Virtual function
Among following which will give the size of object or type ?
Calloc
Malloc
Sizeof
Realloc
Enumerators are stored by the compiler in?
string
integer
float
any of above
How we can define member function outside the class?
Using union
Using structure
Using pointers
Using scope resolution