Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
54 views

Programming in C

This document contains questions related to programming in C++ across multiple units and blocks. It covers topics such as structured vs object-oriented programming, data types, operators, loops, classes, inheritance, polymorphism, templates, streams, and exception handling. Questions range from definitions and short explanations to examples and programs. The focus is on key concepts in C++ and object-oriented programming.

Uploaded by

sofia
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Programming in C

This document contains questions related to programming in C++ across multiple units and blocks. It covers topics such as structured vs object-oriented programming, data types, operators, loops, classes, inheritance, polymorphism, templates, streams, and exception handling. Questions range from definitions and short explanations to examples and programs. The focus is on key concepts in C++ and object-oriented programming.

Uploaded by

sofia
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Programming in c++ (BCS-031)

BLOCK 1
Unit-1

Q. Explain features of structured programming paradigm in brief. Also list its advantages and disadvantages
with respect to Object Oriented Paradigm. 6

Q. Why did people change over from structured programming to object-oriented programming ? Explain it
in brief with the help of an example. 6

Q. What is message passing? Explain how message passing is used in C++ programming with an ex. 10

Q. Write short note on the following : (b) Message Passing 5

Q. What is object - oriented programming paradigm ? Explain advantages of object - oriented programming
paradigm over structured programming paradigm. 6

Q. Explain the basic characteristics of object oriented programming (OOP). Also explain any three
advantages of OOP over procedural programming languages. 6

Q. Explain the basic characteristics of object oriented languages. How is object oriented programming
language better than structured programming language. 8

Q. Explain object oriented concepts. How is object oriented language different from structured programming
language ? 8

UNIT 2

Q. What is data type ? List any four built in data types and their size in C++. Also explain need of derived
data type in C++ programming. 6

Q. What is data type ? Draw hierarchy of data 5 types in C++.

Q. What is an operator ? List the various types of operators used in C++. 8

Q. What is meant by comparison and logical operators ? How are they different from the arithmetic and
assignment operators, explain with the help of an example. 8

Q. What is looping in C++ ? What are the advantages of using loops in C++ ? Also list the various looping
options available in C++. 6

Q. Explain the use of continue statement in C++, with example. 5

Q. Write C++ program to find factorial of a given number using copy constructor. 8
UNIT 3
Q. What is encapsulation ? Explain how it is different from information hiding with the help of an example
program to manage Books issue and return in a Library. 8

Q. Write short note on the following : (a) Encapsulation 5

Q. What is access control specifier ? Explain the need of different access control specifiers with example. 5

Q. What are access control specifiers ? Explain difference between private and public access control
specifiers. 5

Q. Explain the difference between private, protected and public access specifier with respect to class and its
object. Write a program in this support. 10

Q. What is an object ? Explain how objects in C++ are created and destroyed, with the help of program to
create Bank-Account Class, having data members name, account number, balance and member function
display balance.

Q. What is friend function ? Explain its advantage with the help of an example. 5

Q. What are friend functions ? Explain two merits and two demerits of using friend functions with the help
of an example. 8

Q. What is friend function ? Explain its concept with the help of a suitable example. 3

Q. What do you understand by friend function ? Write a C++ program to find out the sum of n given
numbers using friend function. 10

Q. What is meant by object initialization? What is its need ? Explain with the help of a suitable examples. 6

Q. What is static member ? Explain use of static data member and static member function with the help of
an example program in C++. 10

Q. Write short note on the followings : (d) Class and objects 5

Q What is a structure in C++, and how a 6 structure is different from a class ? Explain with example.

Q. What is an object in C++ ? Explain how an object can be passed as an argument to a function with the
help of an example. 5

Unit 4
Q1. Explain the concept of copy constructor with the help of an example program. 6
Q. What is constructor ? Explain advantage of constructor with the help of an example. 5
Q. What is need of memory management in C++ programming ? Explain in brief about memory
management process in C++. 5

Q. What do you mean by copy constructor ? Explain it with a suitable C++ program.

Q. What do you mean by constructors ? Write the characteristics of constructors. Write a program to
illustrate the use of constructor in C++ programming. 10

Q. Differentiate between default constructor and parameterized constructor with the help of an example. 8

Block 2
Unit 1
Q. List the merits and demerits of single inheritance over multiple inheritance. 5
Q. Write C++ program to implement multilevel inheritance. Provide the necessary comments to clarify the
availability of data members and member functions in different classes. 5

Q. What is inheritance ? Explain different types of inheritance supported by C++. 6

Unit 2
Q. Explain need of operator overloading. Also explain why some operators cannot be overloaded ? Write a
C++ program to overload '+' operator to add two character strings. 10

Q. Q. hat are the needs of operator overloading in the program ? Why can't some operators be overloaded ?
Write C++ program to add two complex numbers using plus (+) operator overloading 10

Q. What is operator overloading ? Briefly explain general rules of operator overloading. 6.

Q. What do you mean by operator-overloading ? List the operators which cannot be overloaded. Write a C+
+ program for unary minus (-) operator overloading. 10

Q. What is function overloading?(U-2) How it is different from function overriding? (U-3) Explain with an
example of each. 10

Q. Write short note on the following : (c) Function Overloading 5

Q. How function calls are matched with overloaded functions in C++ ? Explain with the help of a C++
Program. 10

Q. Write short note on the followings : (c) Operator overloading 5


Unit 3
Q. What is polymorphism? Explain advantage of polymorphism. Also write a C++ program to explain use of
virtual function. 10

Q. What do you mean by polymorphism ? How is run time polymorphism different from compile time
polymorphism ? Give example(s) to support the above differentiation 10

Q. What is a virtual function ? Write a program in C++ to create class Doctor with a virtual function salary.
Derive class Visiting - Doctor and implement function salary in it. 8

Q. What is polymorphism ? Explain any three advantages of polymorphism. 5

Q. Write short note on the followings : (a) Abstract classes 5

Q. Why does abstract class play an important role in object-oriented programming ? Write C++ program of
abstract class which uses the concept of pure virtual function. 10

Q. What is an abstract class ? How do you create an abstract class ? What is the purpose of creating an
abstract class in object oriented programming paradigm ? Explain with the help of an example. 8

Q. Explain the concept of virtual function with the help of an example. 5

Q. What happens if we don't use the virtual function in the inheritance ? Explain the importance of virtual
function in the reference of the above, with the help of an example. 10

Block 3
Unit 1
Q1. What is data stream ? Explain stream hierarchy in C++. 5

Q. What is stream manipulator ? Explain use of setw( ) and setprecision( ) as stream manipulator. 5

Q. Write short note on the followings : (b) Input and output streams 5

Q. Explain how setting of field width and setting of precision may be done in C++. 5

Q. Write short note on the following (d) File pointers and operations. 5

Q. What do you mean by the file stream operations ? Write C++ program to demonstrate the reading from
disk file and writing the result to the disk file. 7
Unit 2
Q1. What is function template ? Write a function template SUM to add two numbers. 6

Q. Explain function template with the help of an example. 6

Q. What is template class ? Explain advantages of template class. Create a template class for Linked - List
data structure. 10

Q. What is container ? List main types of container in C++. Also list some common member functions of
container classes. 10

Q. Write a program in C++ using operator template for the binary numbers to perform a simple arithmetic
operations such as add and subtract. 10

Q. Differentiate class template and function template with the help of an example. 8

Q. Describe all types of containers that are available in C++ with their importance, in detail. 10

Unit 3
Q. What is exception? Explain how exception handling is done in C++ with the help of a program. Also
describe what will happen if an exception is thrown out side of a try block and why ? 10

Q. What is need of exception handling in C++ programming ? Explain with an example how exceptions are
handled in C++. Briefly describe the hierarchy of exception classes in C++ standard library. 10

Q. What is exception handling ? How is it performed in C++ ? Explain with the help of an example. 10

Q. What is exception handling ? What are the keywords used to handle the exception in C++ ? Write a C++
program to handle divide by zero exception. 10

Q. Explain a situation when you will use multiple catch statements in a C++ program for exception
handling. 5

Unit 4

You might also like