Sunday, 21 June 2015

bca2030 smu bca Spring 2015 IInd sem assignment

Get fully solved assignment. Buy online from website
online store
or
plz drop a mail with your sub code
we will revert you within 2-3 hour or immediate
Charges rs 125/subject and rs 625/semester only.
if urgent then call us on 08791490301, 08273413412
Spring 2015, ASSIGNMENT
PROGRAM – BCA (REVISED FALL 2012)
SEMESTER - 2
SUBJECT CODE & NAME - BCA2030- OBJECT ORIENTED PROGRAMMING – C++
CREDIT – 4 BK ID - B1641, MAX. MARKS - 60

Q1. Write short notes on:
a) Switch statement
b) Conditional Operator
Answer:
a) Switch statement:
switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and

Q2. Differentiate between Classes and Objects. Write an example program to represent a class and its object. 4+6= 10
Answer:
Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects.
A Class is static. All of the


Q3. Differentiate between Constructors and Destructors.
Answer: Constructor:
  • Constructor is Used to Initialize the Object.
  • Constructor can takes arguments.
  • Constructor overloading can be possible means more than one constructors can be defined insame class.
  • Constructor has same name as class name.
  • Syntax of constructor:
                class class_name
                  {
                     clas_sname(){}
                     class_name(argulist){}
                 } ;

  • Constructor are of following:
               1)Default Constructor.
               2)Parameterized Constructor.
               3)Copy Constructor.
 
  • Constructors can be used to dynamically initialize the memory.
  • Constructor indirectly use the New operator to initialize the object.

Destructor:
  • Destructor is used to destroy the object that are created in memory previously.
  • Destructor can not take any arguments.
  • Destructor overloading can not be possible.
  • Destructor has same name as class name with tiled operator.
  • Syntax of Destructor:
                 class class_name
                   {

                       ~class-name(void){}
                   };
 
  • Destructor has no any types.
  • Destructor can be used to deallocate the memory.
  • Destructor indirectly use the Delete operator to destroy the object initialize by constructor.

Q4. Describe the two basic exception handling models. 10
Answer:
If you encounter an exceptional situation in your code – that is, one where you don’t have enough information in the current context to decide what to do – you can send information about the error into a larger context by creating an object containing that information and “throwing” it out of your current context. This is called throwing an exception. Here’s what it looks like: throw myerr


Q5. Write a C++ program to swap two numbers without using a temporary variable. 10
Answer:
1.      /*
2.       * C++ program to swap two numbers without using a temporary variable
3.       */
4



Q6. Write A C++ program to implement class rectangle and find its area.
Answer:
#include <iostream.h> 

#include<conio.h> 

class Rectangle 

{ 

               int x, y; 


Get fully solved assignment. Buy online from website
online store
or
plz drop a mail with your sub code
we will revert you within 2-3 hour or immediate
Charges rs 125/subject and rs 625/semester only.
if urgent then call us on 08791490301, 08273413412



No comments:

Post a Comment