BCA2030- OBJECT ORIENTED PROGRAMMING – C++

Dear students get fully solved assignments
Send your semester & Specialization name to our mail id :
“ help.mbaassignments@gmail.com ”
or
Call us at : 08263069601


ASSIGNMENT
PROGRAM
BCA(REVISED FALL 2012)
SEMESTER
2
SUBJECT CODE & NAME
BCA2030- OBJECT ORIENTED PROGRAMMING – C++
CREDIT
4
BK ID
B1641
MAX.MARKS
60

Note: Answer all questions. Kindly note that answers for 10 marks questions should be approximately of 400 words. Each question is followed by evaluation scheme.

Q.1 Write short notes on:

a) Switch statement

Answer: A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each case.
The syntax for a switch statement in C++ is as follows:
switch(expression){
    case constant-expression  :
       statement(s);




b) Conditional Operator

Answer: The conditional operator (? :) is a ternary operator (it takes three operands). The conditional operator works as follows:
·         The first operand is implicitly converted to bool. It is evaluated and all side effects are completed before continuing.
·         If the first operand evaluates to true (1), the second operand is evaluated.
·         If the first operand evaluates
·          
·          

Q.2 Differentiate between Classes and Objects. Write an example program to represent a class and its object.

Answer: Objects and classes are used in object oriented programming languages. All object oriented programming languages such as C++, Java, .NET and others, employs objects and classes.
Objects:
An object is defined as any entity that can be utilized by using commands in a programming language. Object can be a variable, value, data structure or a function. In object oriented environment, object is referred to as instance of a class. Objects and classes are closely related to each other. In real world, the objects are your TV, bicycle, desk and other entities.



Q.3 Differentiate between Containers and Iterators.

Answer:Container classes are building blocks used to create object­oriented  programs, and they make the internals  of a program much easier  to construct.
·         A container class describes an object that holds other objects.
·         Container classes are so important that they were considered  fundamental to early object­orie ted languages.
·         The C++ approach to containers is based on templates. The containers in the Standard C++ library represent a broad range of data structures 

Q.4 Describe the two basic exception handling models.

Answer: Exceptions in process modeling indicate a problem that occurs and changes the normal flow of the process. When an exception occurs in the process, the process execution stops at that point. There are two types of exceptions in the process composer: an error and an escalation. They are differentiated by their trigger.
To model exceptions and exceptions handling you create the following event types:
·         Error end event, which you create in the process.
·         The error end event triggers a WSDL fault that is defined in a service interface definition you have in your project.



Q.5 Write a C++ program to swap two numbers without using a temporary variable.

Answer: Program which swaps the values of two variable without using extra variable. The program calls another function which takes variables as the arguments by reference and manipulates them in order to swap their values inside the function body.
Here is source code of the C++ program which swaps the values of two variable without using extra variable.

The C++ program is successfully compiled and run on a Linux system. The program output is also shown below.





Q.6 Write A C++ program to implement class rectangle and find its area.

Answer: #include<iostream.h>
#include<conio.h>
class circle
{
private:
int radius;


Dear students get fully solved assignments
Send your semester & Specialization name to our mail id :
“ help.mbaassignments@gmail.com ”
or
Call us at : 08263069601


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.