0% found this document useful (0 votes)
24K views101 pages

2nd PUC Computer Lab Manual-2023

The document provides a practical blueprint for a C++ and SQL/HTML programming exam containing the following sections: 1) An outline of the exam duration, maximum marks allotted, questions and breakdown of marks. 2) Section A contains 16 C++ programs covering topics like arrays, functions, classes, pointers etc. 3) Section B contains 4 SQL programs on generating bills, creating databases and computing results. 4) Section C contains 2 HTML programs on creating a timetable and table/form.

Uploaded by

Vrishank Rao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24K views101 pages

2nd PUC Computer Lab Manual-2023

The document provides a practical blueprint for a C++ and SQL/HTML programming exam containing the following sections: 1) An outline of the exam duration, maximum marks allotted, questions and breakdown of marks. 2) Section A contains 16 C++ programs covering topics like arrays, functions, classes, pointers etc. 3) Section B contains 4 SQL programs on generating bills, creating databases and computing results. 4) Section C contains 2 HTML programs on creating a timetable and table/form.

Uploaded by

Vrishank Rao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 101

Contents

PRACTICAL BLUEPRINT 2

SECTION A - C++
1.Write a program to find the frequency of an element in an array 3
2.Write a program to insert an element into an array at a given position. 5
3.Write a program to delete an element from an array from a given position. 8
4.Write a program to implement insertion sort. 11
5.Write a program to implement binary search. 14
6. Write a program to compute simple interest and to display the result. 16
7.Write a program to compute the discriminant and print the roots. 18
8. Write a program to implement function overloading. 21
9. Write a program to find the cube of a number using inline functions. 24
10.Write a program to find the sum of series 1+x+x2+--------+xn using constructors. 25
11.Write a program to implement the concept of single level inheritance. 26
12.Write a program to implement the concept of pointers to objects. 28
13.Write a program to perform push items into the stack. 30
14.Write a program to pop elements from the stack. 35
15.Write a program to perform enqueue and dequeue. 41
16.Write a program to create a linked list and append nodes. 47

SECTION B - SQL
17.Generate the electricity bill for one consumer. 50
18.Create a student database and compute the result 55
19.Generate the Employee details and compute the salary based on the department. 63
20.Create database for the bank transaction. 71

SECTION C - HTML
21.Write a HTML program to create a study timetable 81
22.Write a HTML program with table and form. 83

1
PRACTICAL BLUEPRINT

Duration of practical examination


2 Hours

Maximum marks allotted 30 Marks

There will 2 questions for writing


(One from C++ programming and one from either SQL or HTML) (6+6)
Each question carries 6 marks. 12 marks

Execution of any one program


(Examiner’s choice) 6 marks
Generating correct output 2 marks
Viva-voce 4 marks
Practical record 6 marks
Total 30 marks

2
SECTION A - C++
1. Write a program to find the frequency of an element in an array

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
#include<stdlib.h>
class frequency
{
private:
int a[100],se,count,n,i;
public:
void getdata();
void findfreq();
void display();
};
void frequency::getdata()
{
cout<<"How many elements"<<endl;
cin>>n;
cout<<"Enter the elements"<<endl;
for(i=0;i<n;i++)
{
cin>>a[i];
}
cout<<"Enter the element to be searched"<<endl;
cin>>se;
}
void frequency::findfreq()
{
count=0;
for(i=0; i<n; i++ )
{
if(a[i]==se)
count++;
}
}
void frequency::display()
{
if(count>0)
cout<<"frequency of "<<se<<" is "<<count<<endl;
else
cout<<se<<"does not exist"<<endl;
}

3
void main()
{
clrscr ();
frequency x;
x.getdata();
x.findfreq();
x.display();
getch();
}

Sample Run

DIY
OUTPUT 1:

OUTPUT 2:

4
2. Write a program to insert an element into an array at a given position.

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
#include<stdlib.h>
class insertion
{
private:
int a[100],ie,pos,n,i;
public:
void getdata();
void insert();
void display();
};
void insertion::getdata()
{
cout<<"How many elements"<<endl;
cin>>n;
cout<<"Enter the elements"<<endl;
for(i=0;i<n;i++)
{
cin>>a[i];
}
cout<<"Enter the element to be inserted"<<endl;
cin>>ie;
cout<<"Enter the position to be inserted 0 to"<<n<<endl;
cin>>pos;
if(pos>n)
{
cout<<pos<<"is an invalid position"<<endl;
exit(0);
}
}

5
void insertion::insert()
{
for(i=n-1;i>=pos;i--)
{
a[i+1]=a[i];
}
a[pos]=ie;
n++;
cout<<ie<<"is inserted "<<endl;
}
void insertion::display()
{
cout<<"The array after insertion is"<<endl;
for(i=0;i<n;i++)
cout<<setw(4)<<a[i];
}
void main()
{
clrscr();
insertion x;
x.getdata();
x.insert();
x.display();
getch();
}

Sample run

6
DIY

OUTPUT 1:

OUTPUT 2:

7
3. Write a program to delete an element from an array from a given position.

#include<iostream.h>

#include<conio.h>

#include<iomanip.h>

#include<stdlib.h>

class deletion

private:

int n,i,a[100],de,p;

public:

void getdata();

void remove();

void display();

};

void deletion::getdata()

cout<<"How many elements"<<endl;

cin>>n;

cout<<"Enter the elements"<<endl;

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

cin>>a[i];

cout<<"Enter the position to be deleted(0 to"<<n-1<<")"<<endl;

cin>>p;

8
void deletion::remove()

if(p>n-1)

cout<<p<<"is an invalid position";

exit(0);

de=a[p];

for(i=p+1;i<n;i++)

a[i-1]=a[i];

n--;

cout<<de<<"is deleted"<<endl;

void deletion::display()

cout<<"The array after deletion"<<endl;

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

cout<<setw(3)<<a[i];

void main()

clrscr();

deletion d;

d.getdata();

d.remove();

d.display();

getch();

}
9
Sample run

DIY
OUTPUT 1:

OUTPUT 2:

10
4. Write a program to sort the elements of an array in ascending order using
insertion sort.

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
#include<stdlib.h>
class sorting
{
private:
int a[100],n,i,j,t;
public:
void getdata();
void sort();
void display();
};
void sorting::getdata()
{
cout<<"How many elements"<<endl;
cin>>n;
cout<<"Enter the elements"<<endl;
for(i=0;i<n;i++)
{
cin>>a[i];
}
}
void sorting::sort( )
{
for(i=1;i<n;i++)
{
j=i;
while(j>=1)
{
if(a[j]<a[j-1])
{

11
t=a[j];
a[j]=a[j-1];
a[j-1]=t;
}
j--;
}
}
}
void sorting::display()
{
cout<<"The array after sorting is"<<endl;
for(i=0;i<n;i++)
cout<<setw(4)<<a[i];
}
void main()
{
clrscr();
sorting x;
x.getdata();
x.sort();
x.display();
getch();
}

12
Sample run

DIY
OUTPUT 1:

OUTPUT 2:

13
5. Write a program to search for a given element in an array using binary search
method.

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
class bisearch
{
int a[100],n,se,i,beg,end,mid,pos;
public:
void getdata();
void search();
void display();
};
void bisearch::getdata()
{
cout<<"enter no of elements"<<endl;
cin>>n;
cout<<"enter the elements"<<endl;
for(i=0; i<n; i++ )
{
cin>>a[i];
}
cout<<"enter the search element"<<endl;
cin>>se;
}
void bisearch::search()
{
beg=0,end=n-1;
pos=-1;
while(beg<=end)
{
mid=(beg+end)/2;
if(a[mid]==se)
{
pos=mid;
break;
}
else if(se>a[mid])
beg=mid+1;
else
end=mid-1;
}
}
void bisearch::display()
{
if(pos>=0)

14
cout<<se<<"found at position"<<pos<<endl;
else
cout<<se<<"not found"<<endl;
}
void main()
{
bisearch x;
clrscr();
x.getdata();
x.search();
x.display();
getch();
}
Sample run

DIY
OUTPUT 1:

OUTPUT 2:

15
6. Write a program to create a class with data members principle, time and rate.
Create member functions to accept data values to compute simple interest and
display the result.

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
#include<stdlib.h>
class sinterest
{
private:
float p,t,r,si;
public:
void getdata();
void compute();
void display();
};
void sinterest::getdata()
{
cout<<"Enter principal, time and rate"<<endl;
cin>>p>>t>>r;
}
void sinterest::compute()
{
si=(p*t*r)/100;
}
void sinterest::display()
{
cout<<"principle="<<p<<endl;
cout<<"time="<<t<<endl;
cout<<"interest="<<r<<endl;
cout<<"simple interest="<<si;
}
void main()
{
clrscr();
sinterest x;
x.getdata();
x.compute();
x.display();
getch();
}

16
Sample run

DIY
OUTPUT 1:

17
7. Write a program to create a class with data members a,b,c and member
functions to input the data, compute the discriminant based on the following
conditions and print the roots.

● If discriminant=0,print the roots are equal


● If discriminant>0,print the roots are real
● If discriminant<0,print the roots are imaginary

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
#include<stdlib.h>
#include<math.h>
class quadratic
{
private:
double a,b,c,d,r1,r2;
public:
void getdata();
void compute();
void display();
};

void quadratic::getdata()
{
cout<<"Enter the co-efficients"<<endl;
cin>>a>>b>>c;
}
void quadratic::compute()
{
d=(b*b)-(4*a*c);
if(d==0)
{
cout<<"Roots are equal"<<endl;
r1=-b/(2*a);
r2=r1;
18
}
else if(d>0)
{
cout<<"Roots are positive and different"<<endl;
r1=(-b+sqrt(d))/2*a;
r2=(-b-sqrt(d))/2*a;
}
else
{
cout<<"Roots are imaginary"<<endl;
exit(0);
}
}
void quadratic::display()
{
cout<<"root1="<<r1<<endl;
cout<<"root2="<<r2<<endl;
}
void main()
{
clrscr();
quadratic x;
x.getdata();
x.compute();
x.display();
getch();
}

Sample run

19
DIY

OUTPUT 1:

OUTPUT 2:

OUTPUT 3:

20
8. Write a program to find the area of a square/rectangle/triangle using function
overloading.

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
#include<math.h>
class foverload
{
private:
float s;
public:
double area(double s)
{
return(s*s);
}
double area(double l, double b)
{
return(l*b);
}
double area(double a,double b,double c)
{
s=(a+b+c)/2.0;
return(sqrt(s*(s-a)*(s-b)*(s-c)));
}
};
void main()
{
clrscr();
foverload f;
double x,y,z;
int ans;
cout<<"Enter number of sides(1,2 or 3)"<<endl;
cin>>ans;
if(ans==1)
{
cout<<"Enter the side of a square"<<endl;
cin>>x;
cout<<"The area of a square="<<f.area(x)<<endl;
}
else if(ans==2)
{
cout<<"Enter the length and breadth"<<endl;
cin>>x>>y;
cout<<"Area of a rectangle="<<f.area(x,y);
}

21
else if(ans==3)
{
cout<<"Enter three sides of a tringle"<<endl;
cin>>x>>y>>z;
cout<<"Area of a triangle="<<f.area(x,y,z)<<endl;
}
else
cout<<"Invalid choice"<<endl;
getch();
}
Sample run

22
DIY

OUTPUT 1

OUTPUT 2

OUTPUT 3

OUTPUT 4

23
9. Write a program to find the cube of a number using inline functions.

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
class cube
{
private:
int n,c;
public:
void getdata();
void findcube();
void display();
};
void cube::getdata()
{
cout<<"Enter a number to find the cube"<<endl;
cin>>n;
}
inline void cube::findcube() //inline function
{
c=n*n*n;
}

void cube::display()
{
cout<<"cube of"<<n<<"="<<c<<endl;
}
void main()
{
clrscr();
cube x;
x.getdata();
x.findcube();
x.display();
getch();
}

Sample run DIY


OUTPUT 1:

24
10. Write a program to find the sum of series 1+x+x2+--------+xn using constructors.

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
#include<math.h>
class series
{
private:
int b,p,sum,i;
public:
series(int b1,int p1)//parameterized constructor
{
b=b1;
p=p1;
sum=1;
}
void compute();
void display();
};
void series::compute ()
{
for(i=1;i<=p;i++)
{
sum=sum+pow(b,i);
}
}
void series::display()
{
cout<<"Sum of series="<<sum<<endl;
}
void main()
{
int x,n;
clrscr();
cout<<"Enter base and power"<<endl;
cin>>x>>n;
series s(x,n);
s.compute();
s.display();
getch();
}

25
Sample run

11.

DIY
OUTPUT 1:

11. Create a base class containing the data members reg_no and name. Also
create a member function to read and display the data. Create a derived class
that contains marks of two subjects and total marks as the data members and
member functions to read and display the data of the derived class using the
concept of single level inheritance.

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
class student
{
private:
int rno;
char name[30];
public:
void getdata()
{
cout<<"Enter the roll no"<<endl;
cin>>rno;
cout<<"Enter name"<<endl;
cin>>name;
}
void display()
{
cout<<"Rollno:"<<rno<<endl;

26
cout<<"Name:"<<name<<endl;
}
};

:
class marks public student
{
private:
int m1,m2,total;
public:
void getdata1()
{
cout<<"Enter two subject marks"<<endl;
cin>>m1>>m2;
total=m1+m2;
}
void display1()
{
cout<<"Subject1="<<m1<<endl;
cout<<"Subject2="<<m2<<endl;
cout<<"Total marks="<<total;
}
};
void main()
{
clrscr();
marks x;
x.getdata();
x.getdata1();
x.display();
x.display1();
getch();
}
Sample run

27
DIY

OUTPUT 1:

12. Create a class containing the following data members regno, name and fees.
Also create a member function to read and display the data using the concept
of pointers to objects.

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
class student
{
private:
int regno;
char name[30];
float fees;
public:
void getdata();
void display();

};
void student::getdata()
{
cout<<"Enter the register no"<<endl;
cin>>regno;
cout<<"Enter name"<<endl;
cin>>name;
cout<<"Enter fees"<<endl;
cin>>fees;
}
void student::display()
{
cout<<"Registerno:"<<regno<<endl;
cout<<"Name:"<<name<<endl;
28
cout<<"fees:"<<fees<<endl;

}
void main()
{
clrscr();
student s,*sp;
sp = &s;
sp🡪getdata();
sp🡪display();
getch();
}

DIY
OUTPUT 1:

29
13. Write a program to perform push items into the stack.

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
#include<stdlib.h>
#define n 3
class stack
{
private:
int a[n],top,i;
public:
stack()
{
top=-1;
}

void push(int item);


void display();
};
void stack::push(int item)
{
if(top==n-1)
{
cout<<"Stack is full"<<endl;
return;
}
top++;
a[top]=item;
cout<<item<<"is successfully pushed"<<endl;
}
void stack::display()
{
if(top!=-1)
{
30
cout<<"Stack contains";
for(i=0;i<=top;i++)
cout<<setw(3)<<a[i];
cout<<endl;
}
else
cout<<"stack is empty"<<endl;
}
void main()
{
clrscr();
stack s;
int choice,pitem;
while(1)
{
cout<<endl<<"1.Push"<<endl<<"2.Display"<<endl<<"3.Exit"<<endl;
cout<<"Enter your choice"<<endl;
cin>>choice;
switch(choice)
{
case 1:
{
cout<<"Enter the item to be pushed"<<endl;
cin>>pitem;
s.push(pitem);
break;
}
case 2:
{
s.display();
break;
}
case 3:
{

31
cout<<"Thank you"<<endl;
exit(0);
}
default: cout<<"Invalid choice"<<endl;
}
}
}

sample run

32
33
DIY

34
14. Write a program to pop elements from the stack.

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
#include<stdlib.h>
#define n 3
class stack
{
private:
int a[n],top,i;
public:
stack()
{
top=-1;
}
void push(int item);
void pop();
void display();
};
void stack::push(int item)
{
if(top==n-1)
{
cout<<"Stack is full"<<endl;
return;
}
top++;
a[top]=item;
cout<<item<<"is successfully pushed"<<endl;
}
void stack::pop()
{
if (top==-1) // checking underflow condition
{
cout<<”Stack is empty”<<endl;
return;
}
35
cout<<a[top]<<” popped”;
top--;
}
void stack::display()
{
if(top!=-1)
{
cout<<"Stack contains";
for(i=0;i<=top;i++)
cout<<setw(3)<<a[i];
cout<<endl;
}
else
cout<<"stack is empty"<<endl;
}
void main()
{
clrscr();
stack s;
int choice, pitem;
while(1)
{
cout<<endl<<"1.Push"<<endl<<”2.Pop”<<endl<<"3.Display"<<endl<<"4.Exit"<<endl;
cout<<"Enter your choice"<<endl;
cin>>choice;
switch(choice)
{
case 1:
{
cout<<"Enter the item to be pushed"<<endl;
cin>>pitem;
s.push(pitem);
break;
}
case 2:
{
s.pop();
break;
}

36
case 3:
{
s.display();
break;
}
case 4:
{
cout<<"Thank you"<<endl;
getch();
exit(0);
}
default: cout<<"Invalid choice"<<endl;
}
}
}

Sample run

37
DIY

OUTPUT 1: OUTPUT 2

38
OUTPUT 3: OUTPUT 4:

OUTPUT 5: OUTPUT 6:

OUTPUT 7: OUTPUT 8:

39
OUTPUT 9: OUTPUT 10:

40
15.Write a program to perform enqueue and dequeue.

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
#include<stdlib.h>
#define n 3
class queue
{
private:
int a[n],front,rear,count,i;

public:
queue();
void enqueue(int x);
void dequeue();
void display();
};
queue::queue()
{
front=-1;
rear=-1;
count=0;
}
void queue::enqueue(int x)
{
if(rear==n-1)
{
cout<<"Queue is full"<<endl;
return;
}
if(front==-1)
{
front=0;
rear=0;
41
}
else
rear++;
a[rear]=x;
count++;
cout<<x<<"is successfully inserted"<<endl;
}
void queue::dequeue()
{
if(front == -1)
{
cout<<"Queue is empty"<<endl;
return;
}
else
{
int de=a[front];
if(front==rear)
{
front=-1;
rear=-1;
}
else
front++;
count--;
cout<<de<<"is succefully deleted"<<endl;
}
}
void queue::display()
{
if(count>0)
{
cout<<"Queue contains";
for(i=front; i<=rear; i++)

42
cout<<setw(3)<<a[i];
cout<<endl;
}
else
cout<<"Queue is empty"<<endl;
}
void main()
{
clrscr();
queue q;
int choice,itm;
while(1)
{
cout<<endl<<"1.Enqueue"<<endl<<"2.Dequeue"<<endl<<"3.Display"
<<endl<<"4.Exit"<<endl;
cout<<"Enter your choice"<<endl;
cin>>choice;
switch(choice)
{
case 1:
{
cout<<"enter the item to be inserted"<<endl;
cin>>itm;
q.enqueue(itm);
break;
}
case 2:
{
q.dequeue();
break;
}
case 3:
{
q.display();

43
break;
}
case 4:
{
cout<<"Thank you"<<endl;
getch();
exit(0);
}
default: cout<<"Invalid choice"<<endl;
}
}
}

Sample run

44
DIY
OUTPUT 1: OUTPUT 2:

OUTPUT 3: OUTPUT 4:

45
OUTPUT 5: OUTPUT 6:

OUTPUT 7: OUTPUT 8:

OUTPUT 9: OUTPUT 10:

46
16. Write a program to create a linked list and append nodes.

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
class linklist
{
private:
struct node
{
int data;
node *link;
}*start;

public:
linklist();
void append(int x);
void count();
void display();
};
linklist::linklist()
{
start=NULL;
}
void linklist::display()
{
if(start==NULL)
{
cout<<endl<<"linked list is empty"<<endl;
return;
}
cout<<"Linked list contains"<<endl;
node *tmp=start;
while(tmp!=NULL)
{
cout<<tmp->data<<" ";
tmp=tmp->link;
}
}
void linklist::append(int x)
{
node *nnode;
nnode=new node;
nnode->data=x;
nnode->link=NULL;
if(start==NULL)
{
start=nnode;
47
cout<<endl<<x<<"is inserted as the first node"<<endl;
}
else
{
node *tmp=start;
while(tmp->link!=NULL)
tmp=tmp->link;
tmp->link=nnode;
cout<<endl<<x<<"is appended"<<endl;
}
}
void linklist::count()
{
node *tmp;
int c=0;
for(tmp=start;tmp!=NULL;tmp=tmp->link)
c++;
cout<<endl<<"Number of nodes in the linked list="<<c<<endl;
}
void main()
{
clrscr();
linklist *x=new linklist();
x->display();
x->append(5);
x->count();

x->append(6);
x->display();
x->count();

x->append(7);
x->display();
x->count();
getch();
}

48
Sample run

DIY

OUTPUT 1:

49
SECTION B - SQL
17. Generate the electricity bill for one consumer.

1. Create a table for household electricity bill with the following fields:

Field Name Type

RR_Number Varchar2(6)

Consumer_name Varchar2(10)

Date_billing Date

Units Number(4)

create table ebill


(
rrnum varchar2 (6) primary key,
cname varchar2(10),
dob date,
units number(4)
);

Table created.

2. Insert 10 records into the table.

insert into ebill


values('A001','ashish','7-feb-2018',50);
1 row(s) inserted.

insert into ebill


values('A002','akila','13-feb-2018',50);
1 row(s) inserted.

insert into ebill


values('A003','reeta','18-feb-2018',120);
1 row(s) inserted.

insert into ebill


values('A004','seeta','23-feb-2018',90);
1 row(s) inserted.

insert into ebill


values('A005','solanki','24-feb-2018',190);
1 row(s) inserted.

50
insert into ebill
values('A006','solanki','24-feb-2018',190);
1 row(s) inserted.

insert into ebill


values('A007','vikas','21-feb-2018',90);
1 row(s) inserted.

insert into ebill


values('A008','tarun','23-feb-2018',60);
1 row(s) inserted.

insert into ebill


values('A009','patil','23-mar-2018',60);
1 row(s) inserted.

insert into ebill


values('A010','naren','5-mar-2018',110);
1 row(s) inserted.

3. Check the structure of table and note your observation


desc ebill;

4. Add two new fields to the table


·         bill_amt number(6,2)
·         due_date date

alter table ebill


add (amount number(6,2), due_date date);
Table altered.

5. Compute the bill amount for each customer as per the following rules
● Min_amt   Rs. 50
update ebill
set amount=50;
10 row(s) updated.

51
● First 100 units Rs. 4.50/unit
update ebill
set amount=amount+units*4.50
where units<=100;
6 row(s) updated.

● >100 units Rs. 5.50/unit


update ebill
set amount=amount+450+ (units-100)*5.50
where units>100;
4 row(s) updated.
6. Compute due date as billing date+15 days
update ebill
set due_date=dob+15;
10 row(s) updated.

7.  List all the bills generated


select * from ebill;

DIY
Create a table for household electricity bill with the following fields:

Field Name Type

RR_Number Varchar2(6)

Consumer_name Varchar2(10)

Date_billing Date

Units Number(4)

52
Insert 10 records

1.

2.

3.

4.

5.

6.

7.

8.

9.

10.

3. Check the structure of the table and note your observation.

4. Add two new fields to the table ·   


      bill_amt number(6,2)
      due_date date

53
5. Compute the bill amount for each customer as per the following rules
● Min_amt   Rs. 50
● First 100 units Rs. 4.50/unit
● >100 units Rs. 5.50/unit

6. Compute due date as billing date+15 days

7. List all the bills generated

54
18. Create a student database and compute the result.

1. Create a table for a class of students with the following details.

Name Type
Student_id Number(4)
Student_name Varchar2(25)
Sub1_marks Number(3)
Sub2_marks Number(3)
Sub3_marks Number(3)
Sub4_marks Number(3)
Sub5_marks Number(3)
Sub6_marks Number(3)

create table student


(
sid number(4),
sname varchar(25),
m1 number(3),
m2 number(3),
m3 number(3),
m4 number(3),
m5 number(3),
m6 number(3)
);
Table created.

2. Add records into the table for 5 students for name, student_id, student_name and marks
in 6 subjects using insert command

insert into student


values(1000,'harish',34,56,45,52,59,21);
1 row(s) inserted.

insert into student


values(1001,'satish',44,56,45,52,19,21);
1 row(s) inserted.

insert into student


values(1003,'smitha',64,66,65,62,79,81);
1 row(s) inserted.

insert into student


values(1004,'neha',24,26,25,62,49,41);
1 row(s) inserted.

insert into student

55
values(1005,'netra',35,36,35,42,49,41);
1 row(s) inserted.

3. Display the description of the fields in the table using desc command
desc student;

4. Alter the table to add total, perc_marks and result.


alter table student
add (total number(3), percentage number(5, 2), result char(4));
Table altered.

5. Compute total and percentage


update student
set total=m1+m2+m3+m4+m5+m6;
5 row(s) updated.

update student
set percentage=total/6.0;
5 row(s) updated.

6. Compute the result as “pass” by checking if the student has scored more than 35 marks in
each subject
update student
set result='pass'
where m1>=35 and m2>=35 and m3>=35 and m4>=35 and m5>=35 and m6>=35;
2 row(s) updated.

7. Compute the result as “fail” by checking if the student has scored less than 35 marks in
any subject

update student
set result='fail'
where m1<35 or m2<35 or m3<35 or m4<35 or m5<35 or m6<35;
3 row(s) updated.

56
8.   Retrieve all the records of the table
select * from student;

9.     Retrieve only student_id and student_name of all the students


select sid,sname
from student;

10.     List the students who have result as “Pass”


select * from student
where result='pass';

11.     List the students who have the result as “Fail”


select * from student
where result='fail';

57
12. Count the number of students who have passed
select count(*)
from student
where result='pass';

13.   Count the number of students who have failed


select count(*)
from student
where result='fail';

14.   List the students who have percentage greater than 60


select count(*)
from student
where percentage>=60;

15.   Sort the table according to the order of student_id


select * from student
order by sid;

58
DIY

1. Create a student database and compute the result.


Create a table for a class of students with the following details.

Name Type
Student_id Number(4)
Student_name Varchar2(25)
Sub1_marks Number(3)
Sub2_marks Number(3)
Sub3_marks Number(3)
Sub4_marks Number(3)
Sub5_marks Number(3)
Sub6_marks Number(3)

2. Add records into the table for 10 students for student_id, student_name and marks in 6
subjects using insert command

1.

2.

3.

4.

5.

6.

7.

8.

59
9.

10.

3. Display the description of the fields in the table using desc command

4. Alter the table to add total, perc_marks and result.

5. Compute total marks and percentage

6. Compute the result as “pass” by checking if the student has scored more than 35 marks in
each subject

7. Compute the result as “fail” by checking if the student has scored less than 35 marks in any
subject

60
8. Retrieve all the records of the table

9.  Retrieve only student_id and student_name of all the students

10.     List the students who have result as “Pass”

11.     List the students who have the result as “Fail”

12.   Count the number of students who have passed

61
13.   Count the number of students who have failed

14.   List the students who have percentage greater than 60

15.   Sort the table according to the order of student_id

62
19. Generate the Employee details and compute the salary based on the
department.

1. Create the following table employee.

Field name Data type


Emp_id Number(4)
Dept_id Number(2)
Emp_name Varchar2(25)
Emp_salary Number(2)

create table employee


(
eid number(4) primary key,
did number(2),
ename varchar2(20),
esalary number(5)
);
2. Create another table department with the following structure.

Field name Data type


Dept_id Number(2)
Dept_name Varchar2(20)
Supervisor Varchar2(20)

create table dept


(
did number(2),
dname varchar2(20),
supervisor varchar2(20)
);
Table created.

Assume the department names as purchase (id=01), accounts (id=02), sales (id=03), apprentice
(id=04).

3. Enter 10 rows of data for table employee


insert into employee
values(1101,01,'arun',25000);

1 row(s) inserted.

insert into employee


values(1102,02,'priya',27000);

1 row(s) inserted.

insert into employee


63
values(1107,03,'anup',17000);
1 row(s) inserted.

insert into employee


values(1108,04,'varuni',34000);
1 row(s) inserted.

insert into employee


values(1109,02,'aruna',34000);

1 row(s) inserted.

3. Enter  4 rows of data for department table


insert into dept
values(01,'purchase','asha');

1 row(s) inserted.

insert into dept


values(02,'accounts','krishna');

1 row(s) inserted.

insert into dept


values(03,'sales','tanvi');

1 row(s) inserted.

insert into dept


values (04,'apprentice','ashish');

1 row(s) inserted.

4. Find the names of all employees who work for the accounts department

select ename
from employee
where did=(select did from dept where dname='accounts’);

64
5. How many employees work for accounts department?
select count(*)
from employee
where did=(select did from dept where dname='accounts');

6. What is the minimum, maximum and average salary of employees working for accounts
department

select max(esalary),min(esalary),avg(esalary) from employee

where did=(select did from dept where dname='accounts');

7. List the employees working for a particular supervisor


select * from employee
where did=(select did from dept where supervisor='tanvi');

8. Retrieve the department names for each department where only one employee works
select dname from dept
where did in(select did from employee
group by did
having count(*)=1);

9. Increase the salary of all employees in the sales department by 15%


update employee
set esalary=esalary+esalary*0.15
where did=(select did from dept where dname='sales');

1 row(s) updated.
65
10. Add a new column to the table employee, called Bonus number(5) and compute 5% of the
salary to the said field

alter table employee


add bonus number(5);

Table altered.

update employee
set bonus=esalary*0.05;
5 row(s) updated.

11. Delete all the rows the employees in the apprentice department
delete from employee
where did=(select did from dept where dname='apprentice');
1 row(s) deleted.
12. Display all records from employee.
select * from employee;

13. Display all records from department

select * from dept;

66
DIY
1. Create the following table employee.

Field name Data type


Emp_id Number(4)
Dept_id Number(2)
Emp_name Varchar2(25)
Emp_salary Number(2)

Insert the records and write the output.

1.

2.

3.

4.

5.

2. Create another table department with the following structure.


Assume the department names as purchase (id_01), accounts (id_02), sales (id_03),
apprentice(id_04).

Field name Data type


Dept_id Number(2)
Dept_name Varchar2(20)
Supervisor Varchar2(20)

67
3. Insert the records and write the output.

1.

2.

3.

4.

4. Find the names of all employees who work for the accounts department

5. How many employees work for accounts department?

6. What is the minimum, maximum and average salary of employees working for accounts
department

68
7. List the employees working for a particular supervisor

8. Retrieve the department names for each department where only one employee works

9. Increases the salary of all employees in the sales department by15%

10. Add a new column to the table employee, called Bonus number(5) and compute 5% of the salary
to the said field

11. Delete all the rows the employees in the apprentice department

69
12. Display all records from the employee table.

13. Display all records from the department table.

70
20. Create a database for the bank transaction.

1. Create a table for the customer


Name Type Constraint
cno Number(4) Primary key
cname char(25)
caddress Varchar2(50)
cphone char(12)

create table customer


(
cno number(4) primary key,
cname char(25),
caddress varchar2(50),
cphone char(12)
);
Table created.

2. Create a table for the bank


Name Type constraint
accno Number(4) Not null
trnamount Number(8,2) tranamount>0
trdate Date
trtype Char
cno Number(4)

create table bank


(
accno number(4) not null,
trnamount number(8,2) check(trnamount>0),
trdate date,
trtype char,
cno number(4)
);
Table created.

3. Insert data values into customer table

1. insert into customer values


(100,'manoj','MG Road, Bangalore', 2334152513);
1 row(s) inserted.

2. insert into customer values


(101,'suraj','JC Road, Bangalore', 9334152592);
1 row(s) inserted.

71
3. insert into customer values
(102,'raj','KG Road, Bangalore', 8452415255);
1 row(s) inserted.

4. Insert data values into bank table

1. insert into bank values


(1200, 20000, '03-JAN-18', 'd', 100);
1 row(s) inserted.

2. insert into bank values


(1201, 27000, '05-FEB-18', 'c', 101);
1 row(s) inserted.

3. insert into bank values


(1203, 45000, '12-FEB-18', 'c', 101);
1 row(s) inserted.

4. insert into bank values


(1203, 15000, '16-FEB-18', 'd', 101);
1 row(s) inserted.

5. Display all records from customer table


select * from customer;

6. Display all records from bank table.


select * from bank;

7. Display all records from bank table whose transaction date is greater than 5-feb-2018
select * from bank where trdate > '5-feb-2018';

72
8. Join two tables(bank and customer)
select accno, cname, customer.cno from
bank,customer
where customer.cno=bank.cno;

9. Display count of all records and their corresponding transaction, group by transaction
type.
select trtype,count(*)
from bank
group by trtype;

10. Display all records from customer, order by customer name in descending order.
select *
from customer
order by cname desc;

11. Change the transaction amount to 27000 where accno=1201


update bank
set trnamount=27000
where accno=1201;
1 row(s) updated.

73
12. Alter the customer table to change the size of the customer address to char(50).
alter table customer
modify caddress char(50);
Table altered.

13. Delete records from bank having an account number 1202


delete from bank
where accno=1202;
1 row(s) deleted.

14. Create a table containing customer number range between 100 and 101
create table tempcust
as
(
select *
from customer
where cno between
100 and 101
);
Table created.

15. Display records from customers whose name starts with ‘s’
select *
from customer
where cname like's%';

16. Display today’s date


select sysdate from dual;

17. Display total transaction amount from bank table


select sum(trnamount)
from bank;

74
18. Create a view on the customer table showing customer_no and customer phone number.
create view vcustomer
as
(select cno,cphone from customer);
View created.

19. Display records from view

select * from vcustomer;

20. Display a distinct customer number from the bank table.


select distinct cno from bank;

21. Display account number from bank who have more than one transaction.
select accno,count(*)
from bank
group by accno
having count(*)>1;
no data found

22. Display all records from customer whose phone number is NULL
select * from customer
where cphone=null;
no data found

23. Delete all records from customer table


delete from customer;
0 row(s) deleted.

24. Drop table bank


drop table bank;
Table dropped

75
25. Drop table customer.
drop table customer;
Table dropped

DIY

1. Create a table for the customer


Name Type constraint
cno Number(4) Primary key
cname char(25)
caddress Varchar2(50)
cphone Char(12)

2. Create a table for the bank


Name Type Constraint
ccno Number(4) Not null
tranamount Number(8,2) tranamount>0
trdate date
trtype Char
cno Number(4)

3. Insert three records into customer table


1.

2.
76
3.

4. Insert 4 records into bank table


1.

2.

3.

4.

5. Display all records from customer table

6. Display all records from the bank table.

77
7. Display all records from bank table whose transaction date is greater than 5-feb-2023

8. Join two tables(bank and customer)

9. Display count of all records and their corresponding transaction, group by transaction
type.

10. Display all records from customer, order by customer name in descending order.

11. Change the transaction amount to 27000 where accno=1201

78
12. Alter the customer table to change the size of the customer address to char(50).

13. Delete records from bank having an account number 1202

14. Create a table containing customer number range between 100 and 101

15. Display records from customers whose name starts with ‘s’

16. Display today’s date

17. Display total transaction amount from bank table

79
18. Create a view on the customer table showing customer_no and customer phone number.

19. Display records from view

20. Display a distinct customer number from the bank.

21. Display account number from bank who have more than one transaction.

22. Display all records from customer whose phone number is NULL

23. Delete all records from customer table

24. Drop table bank

25. Drop table customer.

80
SECTION C - HTML
21. Write a HTML program to create a study timetable

<html>
<head><title> Study timetable</title></head>
<body bgcolor="yellow">
<h1><center>MY STUDY TIME TABLE FOR THE WEEK</center></h1>
<center><img src="exam.jpg" height="300" width="300"></center>
<br>
<table border=3 align="center">
<tr>
<th>Day/Time</th>
<th>5.00 -6.30 AM</th>
<th>4.30-5.30 PM </th>
<th>5.30 -6.30 PM </th>
<th>6.30 -7.30 PM </th>
<th>9.00 -10.30 PM </th>
</tr>
<tr>
<th>MONDAY</th>
<td>Physics</td>
<td>Chemistry</td>
<td>Maths</td>
<td>Comp. Science</td>
<td>English</td>
</tr>
<tr>
<th>TUESDAY</th>
<td>Maths</td>
<td>Comp. Science</td>
<td>English</td>
<td>II Lang</td>
<td>Physics</td>
</tr>
<tr>
<th>WEDNESDAY </th>
<td>English</td>
<td>II Lang</td>
<td>Physics</td>
<td>Chemistry</td>
<td>Maths</td>
</tr>
<tr>
<th>THURSDAY</th>
<td>Comp. Science</td>
<td>Physics</td>
<td>English</td>
<td>II Lang</td>
<td>Chemistry</td>

81
<td>Maths</td>
</tr>
<tr>
<th>FRIDAY</th>
<td>Comp. Science</td>
<td>English</td>
<td> II Lang </td>
<td>Chemistry</td>
<td>Maths</td>
</tr>
<tr>
<th>SATURDAY</th>
<td>Physics</td>
<td>English</td>
<td>II Lang</td>
<td>Chemistry</td>
<td>Maths</td>
</tr>
</table>
<br>
<marquee >Action is the fundamental key to success</marquee>
</body>
</html>

82
22. Write a HTML program with table and form.

<html>
<head><title> form</title></head>
<body bgcolor="orange">
<h3><center>APPLICATION FORM</center></h3>
<form action="test.php">
<table border=1 color="blue" cellspacing="5" cellpadding="5" align ="center">
<tr>
<td><label>student name</label></td>
<td><input type="text"></td>
</tr>
<tr>
<td><label>Date of Birth</label></td>
<td><input type="date"></td>
</tr>
<tr>
<td><label>Gender</label></td>
<td><input type="radio" name="G" >MALE
<input type="radio" name="G" >FEMALE</td>
</tr>
<tr>
<td><label>email </label></td>
<td><input type="email" >
</tr>

<tr>
<td><label>Second Language chosen</label></td>
<td>
<select type="Second Language">
<option value="Hindi">Hindi</option>
<option value="Kannada">Kannada</option>
<option value="French">French</option>
</td>
</tr>
<tr>
<td><label>Subjects chosen: </label></td>
<td>
<input type="checkbox"> Physics
<input type="checkbox"> Chemistry
<input type="checkbox"> Biology
</td>
</tr>
<tr align="center" >
<td colspan="2">
<input type="submit">
<input type="Reset"></td></tr>
</form>
</html>

83
84
VIVA QUESTIONS
2019-20
Section –A
C++
1. What is object and class in
OOP? Object is an instance of a
class. Class is collection of
similar objects.
A class binds data members and member functions together.

2. Define data abstraction and polymorphism.


Abstraction refers to the act of representing essential features of an entity without including
explanations or any background details about it.
Polymorphism is derived from two Latin words poly (many) morphos (forms)
The concept of using operators or functions in different ways, depending on what they are
operating on, is called polymorphism.

3. List the access specifiers used with a class. Name the default access specifier.
○ Private
○ Public
○ Protected
The default access specifier is private
[Access specifiers define the scope of the
data]

4. Differentiate private and public access specifiers in c++.


Private Public

The members declared as "private" can be The members declared as "public" are
accessed only within the same class and accessible within the class as well as from
not from outside the class. outside the class.

5. Which operator is used to access the members of a class?


Dot [.]Operator is used to access the members of a
class.
6. What is the significance of scope resolution operator?
⮚ Scope resolution operator (::) is used to define the member function outside the class.
⮚ To access global variable, that has same name as local variable.
⮚ To resolve ambiguities or uncertainty during multiple inheritance.

7. What is an array? Mention the disadvantages of an array.


An array is a collection of elements of same data type referred by a single name.
Disadvantage:
85
○ Array is a static structure.
○ We must know in advance how many elements are to be stored in an array.
○ Since an array is of fixed size, if we allocate more memory than requirement
then the memory space will be wasted.

8. Define sorting
The process of arranging elements either in ascending or descending order is called sorting.

9. What is meant by function overloading?


Function overloading is a concept where a program can have two or more functions with
the same name, but each function differing in the number and data type of arguments called
signature of the function. Function overloading is an example of polymorphism.

10. Define inline function. Mention one advantage.


It is a special member function whose function call is replaced by function body.
Advantages
● Inline function increases the speed of execution*
● The readability of the program increases*
● Very efficient code can be generated.
● The inline member functions are compact function calls, thereby the size of the
object code is considerably reduced.

11. What is a constructor? Mention types.


A constructor is a special member function that is used in classes to initialize the objects of a
class automatically. It has the same name as that of the class.
There are three types of constructors, namely:
1. Default constructor
2. Parameterized constructor
3. Copy constructor

12. What is a copy constructor?


Copy constructor is a parameterized constructor using which one object can be copied to
another object.

13. Give difference between default and parameterized constructor.


Default constructor Parameterized constructor

A constructor which doesn’t accept any A constructor which accepts arguments is


arguments is called a default constructor. called a parameterized constructor.

It cannot be overloaded It can be overloaded.

All objects are initialized to same set of Different objects can be initialized to
values. different values.

86
14. Differentiate between base class and derived class.
Base class Derived class

It is the class whose It is the class that inherits the


properties are inherited by properties from the base class. It is
another class. It is also also called as Sub class.
called as Super class

15. What is hierarchical and hybrid inheritance?


Hierarchical Hybrid

When more than one class is derived Hybrid inheritance is a combination of


from a single base class, then that hierarchical and multilevel inheritance
inheritance is called hierarchical [Hybrid inheritance is combination of
inheritance. two or more types of inheritance.]

16. What is a pointer? Mention advantages.


Pointer is a variable which stores the address of another variable.
Advantages:
⮚ Proper utilization of memory
⮚ Dynamic allocation and de allocation of memory
⮚ Easy to deal with hardware components
⮚ It is possible to write efficient programs.
⮚ Establishes communication between program and data
17. What is the use of * and & operators with respect to pointers.
* is pointer operator.it returns the value of the variable,
& is address operator. It returns the memory address of its operand.
18. Define inheritance. Mention types of inheritance.
It is the capability of one class to acquire the properties from another class.
The different types of inheritance are:
○ Single Inheritance
○ Multi Level Inheritance
○ Multiple Inheritance
○ Hierarchical Inheritance
○ Hybrid Inheritance

87
19. List the various operations performed on arrays.
The different operations performed on arrays are
1. Traversing
2. Searching
3. Inserting
4. Deleting
5. Sorting
6. Merging

20. What is searching? Mention the types of searching.


The process of finding out the location of the data item in the given collection of data items is
called searching.
Types
⮚ Linear search
⮚ Binary search

Section-B SQL
21. What is SQL? Mention one SQL package.
SQL stands for Structured Query Language. Language used to communicate with
RDBMS.
Oracle, Sybase, Microsoft SQL Server, Access

22. Mention the logical operators in SQL.


○ AND
○ OR
○ NOT
○ ALL
○ ANY
○ IN
○ LIKE
○ BETWEEN
○ EXISTS
23. What is primary key?
An attribute or Set of attributes which uniquely identify each record in a table.

24. Mention DDL commands used in SQL.


● Create
● Alter
● Drop
[CAD]

88
25. Differentiate DROP and DELETE commands in SQL
DELETE DROP

DELETE is used to remove tuples or rows DROP is used to remove entire table
from a table.

It is a Data Manipulation It is a Data Definition Language (DDL)


Language (DML) command Command

26. Mention the data types used in SQL.


⮚ Int(number)
⮚ Float
⮚ Date
⮚ Char
⮚ Varchar
27. Give the command to display all records or details in the
table. To display all records
Select *
From table name;
To display selected records
Select *
From table _name
Where condition;
28. What is the use of keyword distinct?
It returns unique records, eliminating duplicate records.

29. Differentiate between ORDER BY and GROUP BY CLAUSE in SQL


ORDER BY GROUP BY

ORDER BY sorts the data in ascending or The GROUP BY Statement is used to


descending order. arrange identical data into groups with the
help of some functions

GROUP BY will aggregate records by the


specified columns which allows you to
perform aggregation functions on non-
grouped columns (such as SUM, COUNT,
AVG, etc).

Group by clause is used to group the results


of a SELECT query based on one or more
columns.

30. What are the various group functions in SQL?


The different group functions are:

89
count( ) this function returns the number of rows in the table that satisfies the condition specified in the
where condition.
Max() this function used to get the maximum value from a column.

Min( ) this function used to get the minimum value from a column.

Avg() this function is used to get the average value of a numeric column.

Sum( ) this function is used to get the sum of a numeric column

​ Section-C
​ HTML

31. What is the use of HTML? List the basic


tags. HTML is used to create web pages.
BASIC TAGS
<html>Defines an HTML document
<head> Defines information about the document
<title> Defines a title for the document
<body>Defines the document's body
<h1> to <h6> Defines HTML headings
<p> Defines a paragraph
<br> Inserts a single line break
32. Differentiate between radio button and check box

Radio button Check box

we can select or mark single option we can mark or check all the options
on radio button over the checkbox

Radio buttons are used for a The checkboxes are used for
specific answer. getting multiple answers.

Radio Button is represented by a circle Check Box is represented a square box

33. Mention the purpose of <tr><th> and <td> tags used in the table.
<tr> =Table row.
It is used to create a row
<th>=table heading
Used for headings. The text will be bold.
<td>=table data
Used to add data to the table.
34. What is XML?
XML stands for eXtensible Markup Language.
It is a markup language for documents containing structured information.
Structured information contains both content (words,pictures etc) and some indication of
90
what role that content plays.
XML is a markup language much like HTML. XML was designed to describe data. XML
tags are not predefined in XML. You must define your own tags.

35. List the formatting tags in HTML.


<font> The <font> tag is used to change the format of the text
on the web page
<b> The <b> tag will bold the text inside the tag.

<i> The <i> tag will italicize the text inside the tag.

<u> The <u> tag will underline the text inside the tag.

Header Tags The header tags <h1>, ... <h6> allows us to place
additional importance on the text within such
tags.
<h1> has the largest size, and <h6> the smallest
<center> The <center> tag causes all the text within the tag
to be centered

<p> The <p> tag indicates a new paragraph

<sub> Subscript text

<sup> Superscript text

<mark> Output: HTML Marked Formatting

Eg: [text will be highlighted]


<h2>HTML
<mark>Marked</mark
> Formatting</h2>

36. What is web scripting?


The process of creating and embedding scripts in a web page is known as
web scripting.
37. What is the purpose of anchor tag in HTML?
Anchor tag defines a hyperlink that links one page to another page.
38. What is a frame?
Frames are used to divide the browser window into multiple sections where
each section can load a separate HTML document.
39. What is the use of PHP files?
PHP stands for PHP Hypertext Pre-processor. It is a server side
scripting language.Suitable for server-side web development.
40. Mention the features of DHTML.

91
​ Dynamic content, which allows the user to dynamically change Web page
content.(depending on time and geographical location)
​ Dynamic positioning of Web page elements.

​ Dynamic style, which allows the user to change the Web page's color, font, size or content.

​ Can be used to create animations, games, applications, provide new ways of navigating
through web sites.

VIVA QUESTIONS
2021-22
1. Mention the different access specifiers in C++ Ans:
Private, Ans:Public and Protected

2. What is the significance of scope resolution operator (: :) in C++?


Ans: To define the member functions outside the class.

3. Which is the default access specifier in


C++. Ans: private

4. What is an object?
Ans: Instance of a class (Or Any Relevant Definition).

5. Define class.
Class is a way of grouping objects having similar characteristics

6. Which operator is used to invoke data member and member


function?
Ans: Dot (.) operator.

7. Which types of data members are accessible outside the


class?
Ans: public members

8. What is an array?
Ans: An array is a set of homogeneous elements under the same name and same data type

9. Define data structure.


Ans: A data structure is a specialized format for organizing and storing data.

10. What is an inline function?


Ans: It is a short function where compiler replaces function call with its body.

92
11. What is function overloading?
Ans: Two or more functions have same name, but differs in number of arguments or
data type of arguments.

12. Mention any one need for function overloading.


Ans: It is easier to understand the flow of information and debug (Any Relevant Answer).

13. Define constructor.


Ans: constructor is a special member function that is used to initialize objects of a
class automatically.

14. Mention any one type of constructor.


Ans: Default constructor / Parameterized constructor / Copy constructor.

15. What is destructor?


Ans: Destructor is a special member function which will be executed automatically
when an object is destroyed (Relevant Definition)

16. What is default constructor?


Ans: A constructor with zero arguments is called default constructor.

17. Explain any one rule for writing constructor.


Ans: constructor name should be the same as that of class name. (Any rule)

18. Define pointer?


Ans: A pointer is a variable that holds the memory address of another variable.

19. Expand WWW.


Ans: World Wide Web.

20. Give an example for linear data structure.


Ans: Array / stack / queue / linked list.

21. Define stack.


Ans: STACK is a special type of data structure where data items are inserted and
deleted from one (same) end called top of the stack

22. What is an inheritance?


Ans: Inheritance is the capacity of one class to inherit properties from another class.

23. What is the base class?


Ans: It is the class whose properties are inherited by another class.

24. What is the purpose of <img> tag?


Ans: To insert an image in a webpage.
25. What is the purpose of <tr> tag in html?
93
Ans: To insert row in a table.

26. What is DHTML?


Ans: Dynamic Hypertext Markup Language (DHTML) is a combination of Web
development technologies used to create dynamically changing websites.

27. What is a web page?


Ans: Webpage is a hypertext document on the World Wide Web (website) (Any
Relevant Answer).

28. Mention any one example for a web browser.

29. Mention the Difference between Check Box and Radio


Button Ans: Check Box: Can choose one or more options
Radio button: Can choose only one option

30. Name text formatting tags in HTML


<B>: Bold <I>: Italics <U>: Underline (Any Formatting Tag)

VIVA QUESTIONS, 2022-23


C++ AND DATA STRUCTURES

1. Mention the different access specifiers in C++


Ans: Private, Public and Protected

2. What is the significance of scope resolution operator (: :) in C++ ?


Ans: To define the member functions outside the class.

3. Which is the default access specifier in C++.


Ans: private

4. What is an object?
Ans: Instance of a class (Or Any Relevant Definition)

5. Define class.
Ans: Class is a way of grouping objects having similar characteristics. (Or Any Relevant
Definition)

6. Which operator is used to invoke data members and member functions?


Ans: Dot (.) operator.

7. What is an array?
94
Ans: An array is a set of homogeneous elements under the same name and same data type.
OR
An array is a collection of elements of the same data type and referred by a single name.

8. Define data structure.


Ans: A data structure is a specialized format for organizing and storing data.

9. What is an inline function?


Ans: It is a short function where the compiler replaces a function call with its body.

10.What is function overloading?


Ans: Two or more functions having the same name, but differ in number of arguments or data
type of argument is called function overloading.

11. Mention any one need for function overloading.


Ans: It is easier to understand the flow of information and debug (Any Relevant Answer).

12.Define constructor.
Ans: Constructor is a special member function that has the same name as that of a class
used to initialize the objects of a class automatically.

13.What is destructor?
Ans: Destructor is a special member function which will be executed automatically
when an object is destroyed (Any Relevant Definition)

14.What is the default constructor?


Ans: A constructor with zero arguments or No arguments is called as default constructor.

15.Explain any one rule for writing constructor.


Ans:
● Constructor name should be the same as that of the class name.
● It should be declared under public access specifier.
● Constructor will not have any return type including void.

16.Define pointer?
Ans: A pointer is a variable that holds the memory address of another variable.

17.Give an example for linear data structure.


Ans: Array / stack / queue / linked list.

18.Define stack.
Ans: STACK is a special type of data structure where data items are inserted and deleted
from one (same) end called top of the stack. It follows LIFO.(Last In First Out)

19.What is an inheritance?
Ans: Inheritance is the capability of one class to acquire the properties from another class.

20.What is the base class?


Ans: It is the class whose properties are inherited by another class.
95
HTML

21.What is the purpose of <img> tag?


Ans: To insert an image in a webpage.

22.What is the purpose of <tr> tag in html?


Ans: To insert row in a table.

23.What is DHTML?
Ans: Dynamic Hyper Text Markup Language (DHTML) refers to web content that
changes each time it is viewed. (Any Relevant Definition)

24.What is web page?


Ans: Webpage is an hypertext document on the World Wide Web (website) (Any
Relevant Answer).

25.Mention any one example for a web browser.


 Google Chrome.
 Mozilla Firefox.
 Microsoft Edge.
 Internet Explorer.
 Safari. (Any One)

26.Mention the Difference between Check Box and Radio Button


Ans: Check Box : Can choose one or more options
Radio button : Can choose only one option

27.Name text formatting tags in HTML


<B> : Bold <I> : Italics <U> : Underline (Any Formatting Tag)

28.What is XML
XML is an Extended MarkUp Language for documents containing Structured
information (Any Relevant Definition)

SQL
29.Mention the DDL Commands in SQL
Create , Alter and Drop Commands

30. Mention the DML Commands in SQL


Insert , delete and update Commands

31. Mention the difference between delete and drop command in SQL
Delete command - deletes the records of the table
Drop command - deletes the structure of the table ( remove the table from the database)

32. What is the primary Key?


Primary key is a column in the table which uniquely identifies each row of a table

96
33. Differentiate between order by and group by commands in SQL
Order by – Sort the records in ascending or descending order of the specified column
Group by – List the identical records / data into groups

34.Which command is used to add new columns to the table


Alter Command

35.Which command is used to retrieve records of the table


Select Command

36. Mention any one Group function in SQL


Count() / Max() / Min() , SUM() / AVG() / Distinct()

97
FULL FORMS
1 CPU Central Processing Unit
2 XT Extended technology
3 AT Advanced technology
4 ATX Advanced Technology Extended
5 SATA Serial Advanced technology Attachment
6 BIOS Basic input Output System
7 CMOS Complementary Metal Oxide Semiconductor
8 POST Power On Self Test
10 ISA Industrial Standard Architecture
11 PCI Peripheral Component Interconnect
12 AGP Accelerated Graphics Port
13 IDE Integrated Digital Electronics
14 USB Universal Serial Bus
15 SCSI Small Computer System Interface
16 VGA Visual Graphics Adapter
17 MODEM Modulator Demodulator
18 DVI Digital Video Interface
19 MIDI Musical Instrument Digital Interface
20 DRAM Dynamic Random Access Memory
21 SRAM Static Random Access Memory
22 SDRAM Synchronous Dynamic Random Access Memory
DDR- Double Data Rate Synchronous Dynamic Random Access
23
SDRAM Memory
24 UPS Uninterrupted Power Supply
25 SMPS Switched Mode Power Supply
26 BCNF Boyce Code Normal Form
27 DBMS Database Management System
28 SQL Structured Query Language
29 ISAM Indexed Sequential Access Method
30 DDL Data Definition Language
31 DML Data Manipulation Language
98
32 DCL Data Control Language
33 TCL Transaction Control Language
34 DQL Data Query Language
35 ARPANET Advanced Research Projects Agency Network
36 TCP/IP Transmission Control Protocol/Internet Protocol
37 HTTP Hypertext Transmission Protocol
38 MIME Multipurpose Internet Mail Extensions
39 URI Uniform Resource Identifier
40 FTP File Transfer Protocol
41 SLIP Serial Line Internet Protocol

42 PPP Point To Point Protocol


43 LCP Link Control Protocol
44 NCP Network Control Protocol
45 LAN Local Area Network
46 MAN Metropolitan Area Network
47 WAN Wide Area Network
48 STP Shielded Twisted Pair
49 UTP Unshielded Twisted Pair
50 GSM Global System For Mobile Communication
51 TDMA Time Division Multiple Access
52 CDMA Code Division Multiple Access
53 SIM Subscriber Identity Module
54 WLL Wireless in Local Loop
55 GPRS General Packet Radio Service
56 EDGE Enhanced Data Rates for Global Evolution.
57 SMS Short Message Service
58 Wi-Fi Wireless Fidelity
59 ISP Internet Service Provider
60 OSS Open Source Software
61 FLOSS Free Libre and Open Source Software
62 GNU GNU’s not Unix
63 PHP PHP Hypertext Preprocessor(recursive acronym)
99
64 FSF Free Software Foundation
65 OSI Open Source Initiative(Open Source Software)
66 OSI Open System Interconnect(Networking model)
66 W3C World Wide Web Consortium
67 WWW World Wide Web
68 URL Uniform Resource Locator
69 POP Post Office Protocol
70 SMTP Simple Mail Transfer Protocol
71 NNTP Network News Transfer Protocol
72 IPR Intellectual Property Rights
73 HTML Hyper Text Markup Language
74 DNS Domain Name Server
75 XML Extended Markup Language
76 DHTML Dynamic Hyper text Markup language
77 OOPS Object Oriented Programming Structure
78 EFT Electronic Fund Transfer
79 EBT Electronic Benefits Transfer
80 EDI Electronic Data Interchange

100

You might also like