Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

VIVA QUESTIONS, FEB’ 2024

(BASED ON THE PROGRAMS)


1. Write a program to find the frequency of presence of an element in an array.
2. Write a program to create a class with data member principal, time and rate.
Create member functions to accept data values to compute simple interest and to
display the result.
3. Write a program to create a class with data members a, b, c and
member functions to input data, compute the discriminant based on the
following conditions and print the roots.
- If discriminant=0, print the roots that are equal
- If the discriminant is>0, print the real roots
- If the discriminant is<0, print that the roots are imaginary.

VIVA QUESTIONS
i. Which operator used to access member functions of a class.
dot (.) operator

ii. Which operator used to define the member functions outside the class.
scope resolution operator (::)

iii. Which is the default access specifier of a class


Private

iv. What is a class?


Class is a collection of objects of same characteristics and behavior.

v. What is an object?
Object is an instance of class.

vi. Mention the access specifiers in C++


private,protected,public.

vii. Give an example for data encapsulation.


In a mobile phone,the features like Bluetooth,sms,whatapps are used
without knowledge of how it works.
4. Write a program to insert an element into an array at a given position.
5. Write a program to delete an element from an array from a given position.
6. Write a program to sort the elements of an array in an ascending order using
insertion sort.
7.Write a program to search an element in an array using Binary search method.

1. VIVA QUESTIONS

i. What is an array?
An array is a ordered collection of elements of same data type that share
common name.

What is insertion operation with respect to data structure?

This operation is used to add a new element to the array at a given


position.

What is deletion operation with respect to data structure?

This operation is used to remove an existing element from an array


position.

What is searching?

Searching is the process of finding the location of an element into the


array.

What is the condition to apply binary search technique to search anelement


in an array

The array should be in a sorted order.

What is sorting?

The process of arranging the elements of an array in a order is called sorting

Give an example for the primitive data structure

Int, float, char, double

Give an example for a linear data structure


Array, string, stack, queue, linked list.

Give an example for non-linear data structure


Trees and graphs.
7. Program to find the area of a square/rectangle/triangle using function
overloading.
VIVA QUESTIONS
What is function overloading
Function overloading means two or more functions have same name but
differ in the number of arguments or data types of arguments.

How does the compiler identifies the particular function to be executed


in a set of overloaded functions.
By the number of arguments.

Which characteristics of OOP is implemented using Function


overloading
Polymorphism

8. Program to find the cube of a number using inline function.


VIVA QUESTIONS

i. What is an inline function?


It is a compact function which replaces function call function code.
ii. Give an advantage of an inline function.
Execution speed increases.
iii. Mention any one disadvantage of an inline function
Compilation time is more
Requires more memory.

9. Write a program to find the sum of the series 1+x+x2+...+xn using constructor.
VIVA QUESTIONS
i. What is a constructor?
Constructor is a special member function used to initialize the objects of a
class.
ii. When does a constructor is invoked?
When an object is created.
iii. Mention the types of constructor.
Default constructor.
Parameterized constructor
Copy constructor
iv. Which section of a class a constructor can be defined.
Public
10. Create a base class containing the data members roll number and name. Also
create a member function to read and display the data using the concept of single
level inheritance. Create a derived class that contains marks of two subjects and
total marks as the data members.
VIVA QUESTIONS

i. What is inheritance?
The process of deriving a new class from an existing class is called
inheritance.
ii. What is a base class
The class whose properties are inherited by other classes.
iii. What is derived class?
The class which inherits properties from base class.
iv. Mention the operator used to create a derived class in C++
(:) colon

11. Create a class containing the following data members register No., name and
fees. Also create a member function to read and display the data using the
concept of pointers to objects.
VIVA QUESTIONS
i. What is a pointer?
Pointer is variable which stores the address of another variable.
ii. Mention the address operator in C++
Ampersand(&)
iii. Which operator is used to allocate memory dynamically?
New operator
Which operator is used to deallocate memory dynamically?

Delete operator
PART-B

(HTML)
1. Write a HTML program to create a study time-table.
2. Create an HTML program with table and form.
i. Mention any one web browser.
Google chrome,Mozilla firefox,opera,safari,internet explorer
ii. Mention the text formation tags in HTML
<b> <i><u><small><big><font>
iii. What is the purpose of TR tag in HTML
Tr tag is used to create a row in a table
iv. What is DHTML
Dynamic hyper text markup language is used to create dynamic web
pages.
v. Differentiate between check box and radio button (Exclusively asked
for Application form creation program using HTML)
Checkbox is an element of a form used to select one or more
options.
Radio button is an element of a form used to select single option
vi. How do you change the background colour of a webpage
<body bgcolor=”blue”>
vii. Mention the tag used to scroll a text from one place to another in
HTML
<marquee>
viii. Mention the tag used to ink from one webpage to another.
<a href=”file name”>

(SQL)

1. SQL program to generate Electricity Bill for 10 Consumers


2. SQL program to create student database and compute result.
i. Which command is used to add new columns to the existing table
Alter command
ii. Which command is used to count the number of records in a table
Select count(*) from table name
iii. Differentiate between drop and delete command in SQL
Delete command is used to delete the records in the table
Drop command is used to delete the whole table.
iv. Which clause in SQL is used to sort the records based on one or more
columns
Orderby clause
v. Which command is used to modify the records of the table
Update command
vi. Mention the DDL commands in SQL
Create, alter,drop
vii. Mention the DML commands in SQL
Insert, select,update
viii. Which command is used to retrieve the records of the table.
Select command

You might also like