DCA1203 – Object Oriented Programming – C++

190.00

Description

SESSION SEPTEMBER 2022
PROGRAM BACHELOR OF COMPUTER APPLICATIONS (BCA)
SEMESTER II
COURSE CODE & NAME DCA1203 – Object Oriented Programming – C++
Assignment Set –1
A. What is Friend Class? Explain it with a suitable example program
Ans: Friend Classes
You should use friend class in the situation when the two classes are strongly coupled. For
example, suppose we have a class CCord that represents a coordinate, and a class CCollect
that holds a list of points. The collections class may be used to change the point objects so we
can declare
Buy Complete assignment from us
Price – 190/ assignment
MUJ Manipal University Complete
SolvedAssignments session Jul/Aug 2022
buy cheap assignment help online from us easily
we are here to help you with the best and cheap help
Contact No – 8791514139 (WhatsApp)
OR
Mail us- [email protected]
Our website – www.assignmentsupport.in
B. Write the difference between function overloading and function overriding.
Ans: Function Overloading v/s Function Overriding
You have already studied function overriding in the previous unit and function overloading in
this unit. Now let us compare both the techniques.
 In both the techniques, same function name is used. But different parameters are passed in
2. A. Illustrate, with the help of an example, the procedure to overload a unary
operator.
Ans: Overloading Unary Operators
As you know already that the unary operators are the ones that operate on a single operator.
Some of the unary operators are – the increment (++) and decrement (–) operators, the unary
minus (-) operator and the logical not (!) operator.
B. Differentiate between termination and resumption in Exception Handling.
Ans: Termination vs. Resumption
There are two basic models in exception-handling theory. In termination (which is what C++
supports) you assume the error is so critical that there’s no way to get back to where the
exception occurred. Whoever threw the exception decided there was no way to salvage the
3. What is polymorphism? Briefly describe the various polymorphism methods with
suitable examples.
Ans: Polymorphism
Polymorphism is the ability to present the same interface in different forms. Polymorphism
means “many forms of a single object”. Operator overloading is a kind of polymorphism. An
operation may exhibit different behaviors in different instances. The behavior depends on the
Assignment Set – 2
4 A. Explain the different types of argument-passing techniques with examples.
Ans: After a function is declared, you must be concerned with how interaction will happen to
function from main () function or other function. Interaction with a function can happen by
passing data to a function or by returning values from function. Data can be passed to
B. Explain, with a suitable example, the syntax of the for-loop in C++.
Ans: For loop
The for loops are the most useful type of loops. The syntax of the for loop is shown below.
The loop condition contains three parts. They are: loop initialization, loop termination
condition and statement for the next iteration, and these three parts are separated with semi-
5. Demonstrate the process of opening a file using constructor with suitable example
programs.
Ans: 1. Opening file using constructors
You already know that a constructor initializes an object when it is created. Here to initialize
the file stream object, a filename is used. The following steps are required to do this:
Create a file stream object to manage the stream using appropriate class. That is, to create
6. A. Discuss Class to basic type conversion with the help of example.
Ans: Class to basic type
The overloaded casting operator in C++ allows us to convert class type data to basic types.
The overloaded casting operator has the general form:
operator type name()
B. What is file mode? Describe the various file mode options available.
Ans: We have used if stream and of stream constructors and the open () function to create
new files as well as to open the existing files. You can note that in both the methods only one
argument has been used, and that is the

Reviews

There are no reviews yet.

Be the first to review “DCA1203 – Object Oriented Programming – C++”

Your email address will not be published. Required fields are marked *