PART – A
Answer all the questions, each question carries 1 mark. (20 × 1 = 20)
I. Select the correct answer from the choices given.
1) The large Printed Circuit Board (PCB) having many chips, ports, and controllers mounted on it.
a) Processor b) Motherboard
c) Slots d) Power unit
2) According to which law, the complement of a variable is complemented again, we get the same
variable?
a) Complementarity law b) Absorption law
c) Involution law d) Idempotence law
3) The two input XNOR gate produces the output as high (1) when its inputs are
a) 0,0 b) 1,1 c) 0, 1 d) Both a) and b)
4) Assertion (A): Tree is a linear data structure.
Reason (R): The data items in tree data structure represent hierarchical relationship.
a) A is true, R is false b) A is false, R is false
c) A is false, R is true d) A is true, R is true
5) Given the class
class student
{
int regno;
char name[25];
public:
int marks;
void get();
};
Identify the data members of the class student.
a) regno, name, marks
b) regno, name
c) marks
d) regno, name, marks, get()
6) A non-member function that has full access right to the private and protected members of the class.
a) Inline function b) Friend function
c) Overloaded function d) Both b) and c)
7) The return type of destructor is
a) int b) void c) no return type d) both a) and b)
8) The class whose properties are inherited by another class is
a) Base class b) Derived class c) Virtual class d) Abstract class
9) Given: int * ptr, n = 25; which is the correct way to initialize the pointer?
a) ptr = *n; b) ptr = & n; c) ptr = n; d) n=ptr ;
10) The set of values for an attribute in that column.
a) Tuple b) Fields c) Domain d) Entity
11) The SQL command used to delete the entire table.
a) Delete b) Drop c) Remove d) Desc
12) Correct expansion of HTTP.
a) Hyper Text Transfer Protocol
b) High Text Transfer Protocol
c) Hyper Test Transmission Protocol
d) High Text Transmit Protocol
13) The device that connects dissimilar networks.
a) Hub b) Switch c) Router d) Gateway
14) A non-profit organisation created for the purpose of supporting free software movement.
a) FSF b) GNU c) OSS d) FLOSS
15) The type of web hosting which rents the entire web server from the hosting company.
a) Co-location hosting b) Dedicated hosting
c) Free hosting d) Virtual hosting
II. Fill in the blanks choosing the appropriate word/words from those given in the bracket.
(Data independence, Data integrity, Sequential, Foreign, Datawarehouse, Serial)
16) Data integrity refers to the validity of data.
17) The ability of the database to modify a schema definition at one level without affecting next higher
level is Data independence.
18) In Sequential file organisation records are arranged one after another determined by the key field.
19) Foreign key can be used to cross-reference tables.
20) Datawarehouse is a repository of organisations electronically stored data.
PART - B
III. Answer any four questions. Each question carries 2 marks. (4 x 2 = 8)
21) Write the dual form of:
a) 1 + 0 = 1
b) X . 1 = X
Ans: a) 0.1=0
b) X+0=X
22) Realize OR gate using only NAND gate.
Ans:
23) Write any two features of parameterized constructor.
Ans:
• The parameterized constructors can be overloaded.
• For an object created with one argument, constructor with only one argument is invoked and
executed.
• The parameterized constructor can have default arguments and default values.
24) List the member functions of "ofstream".
Ans: put( ),write( ),seekp( ) , tellp( )
25) Define data model. Mention any one data model.
Ans: A Data Model is an abstract model that describes how the data is represented and used.
Types: Relational model or Network model or Hierarchical model.
26) Mention any two logical operators in SQL.
Ans: NOT, OR, AND, BETWEEN, IS NULL, UNIQUE
27) What is "order by" clause in SQL? Write its syntax.
Ans: ORDER BY clause is used to display the result of a query in a sorted order.
Syntax: SELECT column_list FROM table_name WHERE condition ORDER BY
column_list [ASC / DESC];
PART - C
IV. Answer any four questions. Each question carries 3 marks. (4 x 3 =12)
28) Write a note on UPS and its types.
Ans: UPS (Uninterruptable Power Supply) supplies power from its battery to maintain power in the
event of a power failure.
Two types are:
a) Standby UPS: It monitors the power line and switches to battery power as soon as power goes.
In standby UPS there will be a momentary power lapses when the power turns off.
b) Online UPS: It continuously provides power from its own backup, even when the power is on.
Online UPS avoids those momentary power lapses.
29) Explain the different types of linked list.
Ans:
1. Single linked list: A single linked list contains two field in each node - the data field and link field.
The data field contains the data of that node while the link field contains address of the next node.
Start
10 20 30 40 Null
2. Circular linked lists:
The link field of the last node contains the address of the first node is called as circular linked list. In
circular linked list it is possible to reach any node from any other.
Start
10 20 30 40
3. Doubly linked lists:
Doubly linked list is a linked list in which each node is points both to the next node and also to the
previous node.
INFO
In doubly linked list each node contains three parts:
• FORW : It is a pointer field that contains the address of the next node
• BACK: It is a pointer field that contains the address of the previous node.
• INFO: It contains the actual data.
30) Define:
a) Free store
b) this pointer
c) Self referential structure.
Ans:
a) Free store: Free store is a pool of unallocated memory used by the program for dynamic
allocation.
b) this pointer: Every object has access to its own address through an important pointer called
this pointer.
c) Self referential structure: The self-referential structure are structures that includes element
that is pointing to another structure of same type.
31) What is a file? Compare text file and binary file.
Ans:
The information/data stored under a specific name on a storage device is called file.
Text File
• It is a file that stores information in ASCII characters.
• EOF and EOL characters are allowed.
• In this file translation is required to binary format.
Binary File
• Binary file contains information in the same format as it is held in the memory.
• EOF and EOL characters are not allowed.
• No translation is required.
32) Describe the different levels of RDBMS.
Ans:
Internal level:
• It is the lowest level of abstraction that describes how the data are actually stored.
• It is also known as physical level. It deals with the physical representation of the
data base on the computer.
• It contains the definition of stored record and method of representing the data fields.
Conceptual Level:
• It is the next higher level of abstraction that describes what data are stored in the database
and what relationships exist among those data.
• It is also known as logical level. It deals with the logical structure of the entire database.
• It hides the complexity of physical storage structures.
External level:
• It is the highest level of abstraction that describes only part of the entire database particular
group of users.
• It is also known as view level. It deals with the user's view of the database.
• It allows accessing the database according to the requirement of users.
33) Identify the type of e-commerce in the following cases:
a) Buying of used cars from the owner.
b) Buying of goods by distributor from manufacturer.
c) Buying of goods from Amazon website.
Ans:
a) Consumer to Consumer (C2C)
b) Business to business (B2B)
c) Business to Consumer (B2C)
34) Briefly explain the basic structure of HTML.
Ans:
<HTML>
<HEAD>
<TITLE> ---------- </TITLE>
</HEAD>
<BODY> ----------
----------
</BODY>
</HTML>
<HTML> tag marks the beginning of the HTML and </HTML> tag marks the end of HTML
document.
<HEAD> tag begins the head section of the HTML document and </HEAD> tag defines the end
of the heading.
The <TITLE> tag gives title to HTML document that appears on browser title bar.
<BODY> tag defines the body of HTML document.
PART - D
V. Answer any four questions. Each question carries 5 marks. (4 x 5 = 20)
35) What is primitive data structure? Explain the different operations performed on primitive
data structure.
Ans:
Data structures that are directly operated by the machine level instructions.
Operations performed:
a) Create: Create operation is used to create a new data structure. This operation reserves
memory space for the program elements. It may be carried out at compile time and run time.
Example: int a=10;
b) Select: This operation is used by programmers to access the data within the data structure.
This operation updates or alters data.
Example: cin>>a;
c) Update: This operation is used to change data of data structures.
Example: int a = 10;
a=a+50;
d) Destroy: This operation is used to destroy or remove the data structure from the memory space.
delete is used to destroy objects in C++.
36) Write an algorithm to insert an element into the Queue.
Ans:
Step 1: IF REAR=N-1 then
PRINT “QUEUE IS FULL”
EXIT
[End of if ]
Step 2: IF FRONT=NULL then
FRONT=0
REAR=0
ELSE
REAR=REAR+1
[End of if]
Step 3: QUEUE[REAR]=ITEM
Step 4: RETURN
37) Explain any five characteristics of OOP.
Ans:
1) Object: An object is a collection of data member and associated member functions.
2) Class: Class is a way of grouping objects having similar characteristics.
3) Data abstraction :Data abstraction is the process of representing essential features without including
background detail.
4) Data encapsulation: Data encapsulation combines data and functions into a single unit called class.
5) Inheritance: The process of forming a new class from an existing class is known as inheritance.
6) Polymorphism The ability of an operator and function to take multiple form is known as
polymorphism.
38) Define inline function. Write the situations where inline function may not work.
Ans:
An inline function is a function where a function call statement is replaced by function body when it
is called. It uses keyword called ‘inline’.
The situations where inline function may not work:
1. The inline function definition is too long or too complicated.
2. The inline function is recursive.
3. The inline function has looping constructs.
4. The inline function has a switch or goto.
39) Explain default constructor with syntax and suitable programming example.
Ans:
A constructor which does not take any argument is called a default constructor.
Syntax:
class classname
{
public:
classname( )
{
body of the constructor
}
};
Programming example:
#include<iostream.h>
class sum
{
private:
int a,b;
public:
sum( ) //default constructor
{
a=0;
b=0;
}
void output( )
{
cout<<" The sum is=”<< a+b;
}
};
void main( )
{
sum s;
s.output( );
getch( );
}
40) With a neat diagram explain the different types of inheritance.
Ans:
a. Single Inheritance: If a class is derived from a single base class, it is called as single
inheritance.
Base class Father
Derive class Son
b. Multilevel inheritance: The classes can also be derived from the classes that are already derived.
This type of inheritance is called multilevel inheritance.
Base Class
Grand father
Derived class 1
Father
Derived class 2
Son
Derived class-n
c. Multiple inheritance: If a class is derived from more than one base class then it is called as
multiple inheritance.
Base-1 Base -2 Base- n King Queen
Prince
Derived
class
d. Hierarchical inheritance: If a number of classes are derived from a single base class,
it is called as hierarchical inheritance.
Base Class SCIENCE
Derived Derived Derived PCMC PCMB PCME
class1 class2 class_N
e. Hybrid inheritance: It is a combination of hierarchical and multilevel inheritance.
Base class Cricketer
Derived Derived Batter Bowler
class1 class 2
Derived All-Rounder
class 3
41) Give the measures for preventing virus.
Ans:
• Install the antivirus software and keep updating it.
• Scan and confirm for no viruses before using an external disk like pen drive.
• Download the contents from the internet only through scanning.
• Better use the licensed software.
• Never boot a PC from a floppy unless it is virus free.
• Apply the access control and security to the computer system
PART - E
VI. Answer any two questions. Each question carries 5 marks. (2×5=10)
42) Given the Boolean function F(A,B,C,D) = ∑(5,6,7,10,14,15). Simplify it using K-map.
Ans:
Reduced Expression for Quad 1 – BC
Reduced Expression for Pair 1 - A BD
Reduced Expression for Pair 2 - ACD
Final reduced SOP expression is – BC + A BD + ACD
43) Define a class employee with data members empno, empname and member functions
getdata() and putdata(). Define the member functions outside the class.
Ans:
#include <iostream>
# include< conio.h>
class employee
{
int empno;
char empname[20];
public:
void getdata();
void putdata();
};
void employee::getdata()
{
cout << "Enter Employee Number: ";
cin >> empno;
cout << "Enter Employee Name: ";
cin>> empname;
}
void employee::putdata()
{
cout << "Employee Number: " << empno << endl;
cout << "Employee Name: " << empname << endl;
}
void main()
{
employee e;
clrscr();
e.getdata();
e.putdata();
getch();
}
44) With reference to the table given below, write the SQL query to perform the following
operations:
Table Name: Book
Book - Code Book - Name Book - Qty Book - Price
101 C 5 200
102 Java 10 250
103 Python 20 350
104 HTML 15 150
105 SQL 25 230
a) Display all the records from "Book" table.
b) Add a new field "Total - Cost" to the table book.
c) Calculate the Total - Cost.
d) Find the highest Total - Cost.
e) Delete the record whose Book - Code is 102
Ans:
a) Display all the records from "Book" table.
SELECT * FROM Book;
b) Add a new field "Total - Cost" to the table book.
ALTER TABLE Book ADD(Total_Cost NUMBER(10));
c) Calculate the Total - Cost.
UPDATE Book SET Total_Cost = Book_Qty * Book_Price;
d) Find the highest Total - Cost.
SELECT MAX(Total_Cost) FROM Book;
e) Delete the record whose Book - Code is 102
DELETE FROM Book WHERE Book_Code=102;
*****
DEPARTMENT OF COMPUTER SCIENCE
CREATIVE EDUCATION FOUNDATION KARKALA
• Mr. Jnanesh Kotian
• Mr. Pratheek Kumar
• Mr. Mahesh Kumar C
• Mr. Sujan J
• Mrs. Megha N
• Mrs. Geetha Prasad
• Ms. Vinaya
• Mrs. Smitha
• Ms. Chandana M C
• Mr. Raveesha R
www.creativeedu.in
Phone No: 9019844492