a)Explain how polymorphism can be implemented using function overloading.
b) Describe the mechanism of accessing data members and member functions in the following cases:
- Inside the main program
- Inside a member function of the same class
- Inside a member function of another class
c) Rewrite the following program after removing the syntax errors (3)
#include<iostream.h>
class Room
{
int length;
int width;
public
Room()
{ length=0;
width=0;
}
Room (int value=8)
{
length=width=8;
}
void display( )
{
cout<<length<<’’ <<width;
}
};
void main( )
{
Room obj Room1;
obj Room1.display( );
}
OR
Write a program in C++ to demonstrate constructor overloading.
d)Convert the following infix expression into postfix
(A*B – (C – D))/(E + F)
OR
Calculate the value of the following postfix expression
54 6 + 7 4 – * 9/35 15 + +
e) Write the steps to search 23 using binary search in the following array
A
OR
Write the algorithm for Selection sort.
f) Differentiate between ‘IN’ and ‘BETWEEN’ operator in SQL with example.
OR
Write the necessary SQL commands to create a table STUDENT with the following attributes
Roll_No integer
Name char (35)
address varchar2 (70)
Set the Roll_No as the primary key of the table.
g) Identify each of the following logic gates by name and construct their respective truth table.
OR
Construct a truth table for the following function and from the truth table obtain an expression for the inversion function
F (A, B, C) = A + BC’
h)Write the advantages of STAR topology.
i)Write a short note on twisted pair cable.
OR
Write a short note on Firewall