Sunday, 14 December 2014

1. Explain Rules for overloading operators?
2. Explain Binding in c++?
3. Explain Exception Handling?

Exception Handling Lab Program

#include <iostream>
double division(int a, int b)
{
     if( b == 0 )
     {
                throw "Division by zero condition!";
      }
      return (a/b);
}
int main ()
 {
int x = 20;
int y = 0;
double z = 0;
try
{
     z = division(x, y);
     cout << z << endl;
}
catch (const char* msg)
{
     cerr << msg << endl;
}
return 0;
}

Saturday, 15 November 2014

OOP THROUGH C++ ASSIGNMENT 3 QUESTIONS

1. Explain Classes in c++?
2. Explain Defining Member functions?
3. Explain Data Hiding?
4. Explain the following?
    a) static Member Variables
    b) static Member Functions
    c) static Object
5. Explain friend Functions?
6. Explain friend Classes?

Friday, 7 November 2014

Write a C++ program to check whether the given number is even or odd (using ? : ternary operator )

#include<iostream>

int main()

{

int a;

cout<<"Enter a Number : ";

cin>>a;

(a%2==0)?cout<<"Number is even":cout<<"Number is odd";

cin.ignore();

cin.get();

return 0;

}

Write a C++ Program illustrating Function Overloading.



#include<iostream.h>

#include<stdlib.h>

#include<conio.h>

#define pi 3.14

class fn

{

public:

void area(int); //circle

void area(int,int); //rectangle

void area(float ,int,int); //triangle

};

void fn::area(int a)

{

cout<<"Area of Circle:"<<pi*a*a;

}

void fn::area(int a,int b)

{

cout<<"Area of rectangle:"<<a*b;

}

void fn::area(float t,int a,int b)

{

cout<<"Area of triangle:"<<t*a*b;

}

void main()

{

int ch;

int a,b,r;

clrscr();

fn obj;

cout<<"\n\t\tFunction Overloading";

cout<<"\n1.Area of Circle\n2.Area of Rectangle\n3.Area of Triangle\n4.Exit\n:”;

cout<<”Enter your Choice:";

cin>>ch;

switch(ch)

{

case 1:

cout<<"Enter Radius of the Circle:";

cin>>r;

obj.area(r);

break;

case 2:

cout<<"Enter Sides of the Rectangle:";

cin>>a>>b;

obj.area(a,b);

break;

case 3:

cout<<"Enter Sides of the Triangle:";

cin>>a>>b;

obj.area(0.5,a,b);

break;

case 4:

exit(0);

}

getch();

}

Write a C++ Program illustrating to sort integer numbers.

#include <iostream.h>
void main(void)
{
int t,i,j;

int n;

cout<<"Enter the number of values to be sorted ";

cin>>n;

int s[20];

cout<<"\nEnter  values ";

for(i=0;i<n;i++)

cin>>s[i];

cout<<endl;

cout<<"sorted list is ";

for(i=0;i<n;i++)

{

for(j=0;j<n-i;j++)

{

if (s[j]>s[j+1])

{

t=s[j+1];

s[j+1]=s[j];

s[j]=t;

}

}

cout<<endl;

cout<<"Pass "<<i+1<<" ";

for(int k=0;k<n;k++)

cout<<s[k]<<" ";

}

cout<<endl;

}

Write a C++ program illustrating interactive program for computing the roots of a quadratic equation by handing all possible cases use streams to perform I/O operations

#include<iostream.h>
#include<math.h>
int main()
{
float a,b,c,d,root1,root2;
cout<<"Enter value of a, b and c : ";
cin>>a>>b>>c;
d=b*b-4*a*c;
if(d==0)
{
root1=(-b)/(2*a);
root2=root1;
cout<<"Roots are real & equal";
}
else if(d>0)
{
root1=-(b+sqrt(d))/(2*a);
root2=-(b-sqrt(d))/(2*a);
cout<<"Roots are real & distinct";
}
else
{
root1=(-b)/(2*a);
root2=sqrt(-d)/(2*a);
cout<<"Roots are imaginary";
}
cout<<"\nRoot 1= "<<root1<<"\nRoot 2= "<<root2;
getch();
return 0;
}

Friday, 10 October 2014

OOP IMP QUESTIONS



  1.    Explain the Key concepts of Object Oriented Programming?
  2.    Difference between c and c++, disadvantages of conventional programming, programming paradigms.
  3.    a) Explain Memory Management Operators?
  b)  Explain user defined data types? 
4.   a) Explain parts of a function?
 b) Explain the following?
i) Call by values ii) Call by reference..   

Thursday, 9 October 2014

#include<iostream.h>
#include<conio.h>
int main()
{
     unsigned long int fact(int);
     unsigned long int f;
     int x;
     cout<<"Enter a Number: ";
     cin>>x;
     f=fact(x);
     cout<<"Factorial of  "<<x<<"  is  "<<f;
     return 0;
}
unsigned long int fact(int a)
{
    unsigned long int factorial;
    if(a==1)
              return 1;
   else
              factorial=a*fact(a-1);
   return factorial;
}


Saturday, 20 September 2014

Write a C++ program illustrating Swapping integer values by reference.

#include<iostream.h>
#include<conio.h>
void swap (int &a, int &b)
{
/* &a and &b are reference variables */
int temp;
temp=a;
a=b;
b=temp;
}
main()
{
clrscr();
int i=5,j=10;
cout<<"Before swapping I = "<<i<<" J = "<<j<<endl;
swap(i,j);
cout<<"After swapping I = "<<i<<" J = "<<j<<endl;
}

Write a C++ program illustrating Variable Scope

Write a C++ program illustrating Variable Scope
A scope is a region of the program and broadly speaking there are three places, where variables can be declared:
·         Inside a function or a block which is called local variables,
·         In the definition of function parameters which is called formal parameters.
·         Outside of all functions which is called global variables.
Local Variables:
Variables that are declared inside a function or block are local variables. They can be used only by statements that are inside that function or block of code. Local variables are not known to functions outside their own. Following is the example using local variables:
#include <iostream>

int main ()
{
  // Local variable declaration:
  int a, b;
  int c;

  // actual initialization
  a = 10;
  b = 20;
  c = a + b;

  cout << c;

  return 0;
}

Global Variables:

Global variables are defined outside of all the functions, usually on top of the program. The global variables will hold their value throughout the life-time of your program.
A global variable can be accessed by any function. That is, a global variable is available for use throughout your entire program after its declaration. Following is the example using global and local variables:
#include <iostream>
// Global variable declaration:
int g;
 int main ()
{
  // Local variable declaration:
  int a, b;
 
  // actual initialization
  a = 10;
  b = 20;
  g = a + b;
 
  cout << g;
 
  return 0;
}
A program can have same name for local and global variables but value of local variable inside a function will take preference. For example:
#include <iostream>
// Global variable declaration:
int g = 20;
 int main ()
{
  // Local variable declaration:
  int g = 10;

  cout << g;

  return 0;
}


Friday, 25 July 2014

Software Engineering IMP QUESTIONS

1. Explain about Object Oriented Design Process in detail? (refer Somerville text book)
2. What is White Box Testing? Explain White Box Testing Techniques?
3. Explain about Risk Projection?
4. What are the different metrics for software quality? (Page No. 661)
5. Explain about Formal Technical Reviews?

Monday, 14 April 2014


1.   What are the guidelines for selecting the proper device based control? Explain in detail?
2.   Explain in detail about the factors considered in choosing colors?
3.   Give a brief note about the features of User interface building tools?
4.   a) What are function keys? What are their advantages?
b)  Explain the following
          i) Track ball        ii) Touch Pad.

Tuesday, 1 April 2014

SE I UNIT ASSIGNMENT QUESTIONS

1. Define Software Engineering? Explain the Changing nature of Software?
2. Explain Software Myths?
3. Explain Process Framework?
4. Explain CMMI Model?
5. What is a Process Pattern? Explain Ambler Pattern?
6. What formal techniques are available for assessing the software process?
7. Explain Personal and Team Process Models?

Last date for submitting the assignment 9-4-2014

Saturday, 1 March 2014

C Programs

B V C Engineering College :: Odalarevu
Department of Computer Science and Engineering
List of C Programs

Mathematical Programs

2.       Reverse a given number .
5.       Write a C program to print Pascal Triangle.

Number Programs in C Programming

13.   Write a c program to print multiplication table of a given number (using while loop and for loop).
1-D Array Programs
16.   Program to Insert element in an Array and delete an element from an array.



2-D Array Programs

Conversion Programs :

Pointer Programs

22.   C Program to Swap Two Numbers  using Pointer and without using pointers (call by reference, call by value).

Recursive Programs

27.   C Program to print Tower of Hanoi using recursion .

Series

Sum=1-x2/2!+x4/4!-x6/6!+x8/8!-x10/10!

Sizeof Operator

Sorting

String Operations Without using Library Function

Structure Concept



Monday, 17 February 2014

Software Engineering Important Questions




1.    Explain Components and Connectors View?
2.    Explain Design Concepts?
3.    Explain Black Box Testing?
4.    Explain the Following?
a)    Coverage Analysis        b) Reliability              c) Defect Removal Efficiency