Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Prep Udupi Paper PU II Year 2024

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

Preparatory Question Paper of Karkala

(Udupi District) Jan 2024


with Complete Key Answers of All Parts.

Prepared by:

Cs - Mahesh Arali

Page 1 of 16
CREATIVE PRE-UNIVERSITY COLLEGE, KARKALA
PREPARATORY EXAMINATION JANUARY - 2024
II PUC COMPUTER SCIENCE (41)

Time: 3 Hour 15 Minutes Max. Marks: 70

Answer all the questions. Each question carries one mark. 1 x 20 = 20

I. Select the correct answer from the choices given: (Repeated answers will not be
considered)
1. CD-ROM drives or hard disk drives are connected to the motherboard through
A) South bridge
B) IDE port
C) Disk controller
D) PS-2 port

2. Min term notation of x̅ YZ is .


A) m3
B) M5
C) M3
D) m5

3. What will be the input for three input XOR gate to get output 1?
A) 0,0,0
B) 1,0,0
C) 0,1,1
D) Both B and C

4. Assertion (A): Stack follows LIFO order.


Reason (R): In stack First, inserted element will be removed First.
A) Both A and R is false
B) A is true but R is false
C) A is true and R is the correct explanation for A
D) A is false but R is correct related to stack

5. Which access specifier is known as by default access specifier?


A) Private
B) Public
C) Protected
D) None of the above

6. Which function replace function call with function body?

Page 2 of 16
A) Friend function
B) Member function
C) Non-member function
D) Inline function

7. Which of the following is not related to the constructors?


A) Its name is same as that of class name
B) It must be under public access specifier
C) It can return value
D) It can be called automatically when object is created

8. Which of the following is not a characteristics of protected visibility mode?


A) Protected members of base class become protected derived class
B) Public members of base class become public in derived class
C) Private members of base class cannot be inherited
D) All the above

9. int a=20,*p=&a,b=*p;
cout<<*p+20<<setw(5)<<b;
What will be displayed on output screen?
A) 40 20
B) 20 40
C) 40 40
D) Syntax Error

10. Candidate keys which are not currently selected as primary key is called ___
A) Super key
B) Alternate key
C) Composite key
D) Foreign key

11. Which of the following is not DDL command?


A) Create
B) Delete
C) Drop
D) Alter

12. A software that is neither open nor freely available is ___

Page 3 of 16
A) Open-source software
B) Freeware
C) Proprietary software
D) FLOSS

13. Which of the following is the first computer network?


A) TCP/IP
B) ARPANET
C) TELNET
D) INTERNET

14. UTP cables can have maximum segment length of ___


A) 100 meters
B) 260 meters
C) 500 meters
D) No restrictions

15. In which type of hosting the company rents an entire server from the hosting
company?
A) Free hosting
B) Virtual hosting
C) Dedicated hosting
D) Shared hosting

II. Fill in the blanks choosing the appropriate word from the brackets
(database, record, normalization, information, data mining)
16. A single entry in the table is called record
17. Data base is the collection of logically related data.
18. Normalization is the process of organizing the data in data base.
19. Information is a processed data.
20. Process of extracting knowledge from collected data is called data mining.

III. Answer any four questions. Each question carries two marks 4X2=8
21. State and prove complementary law.
Ans: This law states that when a variable is ANDed with its complement is equal to 0
and a variable is ORed with its complement is equal to 1”.
X + X’ = 1
Proof:

Page 4 of 16
If X = 0
Then LHS
= X+X’
= 0+1
=1

If X = 1
Then LHS
= X+X’
= 1+0
=1

X . X’ = 0
Proof:
If X = 0
Then LHS
= X.X’
=0.1
=0

If X = 1
Then LHS
= X.X’
=1.0
=0

22. Prove that X+YZ=(X+Y) (X+Z) algebraically.


Ans: (X + Y) (X +Z)
Or

(X + Y) . (X + Z) = X + YZ
Proof:
Then LHS
(X + Y) . (X + Z)
= XX + XZ +XY + YZ
=X + XZ + XY + YZ
Taking X as common in first two expression
= X (1 + Z) + XY + YZ

Page 5 of 16
= X + XY + YZ
Again taking X as common in first two term
= X (1 + Y) + YZ
= X + YZ
RHS

23. What are base class and derived class with reference to OOP?
Ans: Base class: It is the class whose properties are inherited by another class. It is
also called Super Class.
Derived class: It is the class that inherits properties from base class (es).It is also
called Sub Class.

24. What is a destructor? Which is the operator used with destructor function?
Ans: A destructor is a special member function that will be executed automatically
when an object is destroyed.
It will have, like constructor, the name same as that of the class but preceded by a
tilde (~).
25. Differentiate between read( ) and write( ) functions with reference to binary files.
Ans:
Read ( ) Write ( )
This function is used to read This function is used to write
data from a binary file data to a binary file
This function belongs to class This function belongs to class
ifstream. ofstream.

26. Mention the database users.


Ans: The different database users
1. Database administrator
2. Database designers
3. Application programmers
4. End users

27. Write the syntax and example for ALTER command.


Ans:
Syntax:
Alter table tablename ADD(columnname1 datatype1);
Alter table tablename MODIFY(columnname1 datatype1);
Alter table tablename DROP(columnname1);

Page 6 of 16
28. Briefly explain circuit switching.
Ans: In this technique, first the complete physical connection between two computers
is established and then data are transmitted from the source computer to the
destination computer.

IV. Answer any four questions. Each question carries THREE marks 4X3=12
29. What is the function of UPS? Explain its types.
Ans: An UPS is a power supply that includes a battery to maintain power in the event
of a power failure. Typically, an UPS keeps a computer running for several minutes
to few hours after a power failure, enabling us to save data gracefully.
1. Online UPS – An online UPS avoids those momentary power lapses by continuously
providing power from its own inverter, even when the power line is functioning
properly.
2. Standby UPS – A Standby UPS (or off-line UPS) monitors the power line and
switches to battery power as soon as it detects a problem. The switch over to
battery, however, can require several milliseconds, during which time the computer
is not receiving any power.

30. Explain the working of NAND gate with circuit symbol and truth table.
Ans: The NAND Gate has two or more input signals but only one output signal. If all
of the inputs are 1 (high), then the output produced is 0 (low).

Page 7 of 16
A B Y=(A.B)’
0 0 1
0 1 1
1 0 1
1 1 0

31. Explain the types of linked list.


Ans: The types of linked list as follows:
1) Single linked list: A singly linked list contains two fields 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. Since there is only one link
field in each node, the linked list is called as singly linked list.

2) Doubly linked list: It is a linked list in which each node is points both to the
next node and also to the previous node. In doubly linked list each node
contains three parts – FORW, BACK and INFO.
BACK: It is a pointer field containing the address of the previous node.
FORW: It is a pointer field that contains the address of the next node.
INFO: It contains the actual data.

3) Circular linked list: In circular lists, if the link field of the last node contains the
address of the first node, such a linked list is called as circular linked list.

32. Write the difference between static and dynamic memory allocation.
Ans:
Static Memory Dynamic Memory
Allocation Allocation
Memory space is allocated Memory space is allocated
before the execution of during the execution of
program programs
Memory space allocated is fixed Memory space is allocated is
not fixed
More memory space is required Less memory space is required
Memory allocation is from stack Memory allocation is from heap
area area

33. Write the difference between get() and put() functions.

Page 8 of 16
Ans:
Get ( ): The get member function belongs to the class ifstream and reads a single
character from the associated stream.
Ifstream object.get(ch);
ch is character constant or char variable. The function reads ch from the
file represented by the ifstream_object into the variable ch.

Put ( ): The put member function belongs to the class ofstream and writes a single
character to the associated stream.
Ofstream object .put(ch);
ch is character constant or char variable. The function writes ch onto the
file represented by ofstream_object.

34. Explain ISAM with its advantages.


Ans: ISAM is the hybrid between sequential and direct access file organization. The
records within the file are stored sequentially but direct access to individual records is
possible through an index. Indexing permit access to selected records without
searching the entire file.
Advantages:
1. Efficient data retrieval
2. Support for random access
3. Data integrity and reliability

35. Explain any three types of E-commerce.


Ans: There are four types of e-commerce as follows:
1. Business-to-Business: The exchange of services, information and/or products from
one business to another business partners.
2. Business-to-Consumer: The exchange of services, information and/or product
from business to a consumer.
3. Consumer-to-Business: Customer directly contact with business vendors by posting
their project work with set budget online so that needy companies review it and
contact the customer directly with bid.
4. Consumer-to-Consumer: E-commerce is simply commerce between private
individuals or consumers.

36. Explain any three text resizing tags in HTML.


Ans:

Page 9 of 16
Tag Description
<p>Some text </p> Adds a paragraph break after
the text.
<p align=”left”> Some Left justify text in paragraph.
text</p>
<p align=”centre”> Some Centre text in paragraph
text</p>
<nobr>Some text </nobr> Turns off automatic line breaks
even if text is wider than the
window.

V. Answer any four questions. Each question carries FIVE marks 4X5=20
37. Write an algorithm for deleting an element from the front end of queue.
Ans:
Step 1: If FRONT = NULL Then [Check whether QUEUE is empty]
PRINT “Underflow”
Exit
Step 2 : ITEM = QUEUE[FRONT]
Step 3: If FRONT = REAR Then [If QUEUE has only one element]
FRONT = NULL
REAR = NULL
Else
FRONT = FRONT + 1 [Increment FRONT pointer]
Step 4: Return

38. What is sorting? Write an algorithm for insertion sort.


Ans: The process of arranging the data items in some type of order either ascending
or descending is called as sorting.
Algorithm:-
Step 1: for I = 1 to N-1
Step 2: J=I
While ( J >= 1 )
If( A[J] < A[J-1])
temp = A[J]
A[J] = A[J-1]
A[J-1] = temp
If end

Page 10 of 16
J = J-1
While end
for end
Step 3: Exit

39. Give the differences between procedural oriented programming and object-
oriented programming.
Ans:
POP OOP
Large programs are divided into Programs are divided into objects
smaller programs known as functions
Data is not hidden and can be Data is hidden and cannot be
accessed by external functions accessed by external functions
Follow top-down approach in the Follows bottom-up approach in the
program design program design
Data may communicate with each Objects may communicate with each
other through functions other through functions.
Emphasize is on procedure rather Emphasize is on data rather than
than Data Procedure
It has no access specifier It has following access specifiers
Private, Public & Protected
It does not support inheritance Supports inheritance

C, Pascal C++, Java

40. What is function overloading? Write its advantages.


Ans: Using a single function name performing different types of task is called as
function overloading.
Advantages:
1. Code is executed faster.
2. It is easier to understand the flow of information and debug.
3. Code maintenance is easy.
4. Easier interface between programs and real-world objects.
5. It saves the memory space.
6. Multiple functions can share the same name.
7. A compiler need not search for different function name those perform similar
kind of jobs. But there should be a focus towards function arguments

41. Explain the features of default constructor. Write the syntax and example for

Page 11 of 16
default constructor.
Ans: Features of default constructor as follows:

1. For every object created, this constructor is automatically called.


2. All objects of a class are initialized to same set of values by the default
constructor.
3. If different objects are to be initialized with different values, it cannot be done
using default constructor.

Syntax:
Class classname
{
Private:
………..
Public:
Classname( )
{
……….
……….
}
Member functionname( );
};

Ex:
Class Queue
{
Private:
Int front, rear, count;
Public:
Queue( )
{
Front = -1;
Rear = -1;
Count = 0;
}
enqueue(item);
};

Page 12 of 16
42. What is inheritance? Write the advantages of inheritance in C++.
Ans: Inheritance is a process by which object of one class acquires the properties of
object of another class is called as inheritance.
Advantages of inheritance:
1) Reusing existing code
2) Faster development time
3) Easy to maintain Prepared by
4) Easy to extend Cs-Mahesh Arali
5) Memory Utilization
6) Testing and debugging is easy

43. Write the differences between Hierarchical data model and Network data model.
Ans:
Hierarchical data model Network data model
This data model organizes the data This data model organizes the data
in a tree like structure. in the form if graph.
All the nodes are linked to each All the nodes are linked to each
other with a definite hierarchy other without any hierarchy
This model is easy to design and It is powerful model, but database
simple. design is complicated.
This model represents the nodes as This model has many-to-many
one-to-one and one-to-many relationship on data.
relationships.
The data access is quite predictable It has one parent node and many
in the structure and hence the child nodes known as dependents,
process of retrieval and updates are hence the data access is easier.
optimized.

44. What is networking? Explain the goals of networking.


Ans: Network is an inter-connection of autonomous computers. Two computers are
said to be interconnected if they are capable of exchanging the information.
Goals of computer network:
1. Communication: Communication: Networking allows computers and devices to
communicate and share information with each other.
2. Resource sharing: Networking facilitates the sharing of resources such as printers,
files, and applications among connected devices.
3. Data transfer: Networking aims to provide fast and reliable data transfer between
devices. This includes transferring data over local area networks (LANs), wide area
networks (WANs), and the internet.

Page 13 of 16
4. Scalability: Networks need to be scalable to accommodate growth and increased
demand. A goal of computer networking is to design and implement networks that
can effectively handle expanding user base.
5. Security: Network security is a critical aspect of computer networking. Goals in this
area include protecting data and resources from unauthorized access, ensuring
privacy.

VI. Answer any TWO questions. Each question carries FIVE marks 2X5=10

45. Simplify the following Boolean expression using K-map.


F (A, B, C, D) = ∑ (0,1,2,3,6,7,8,15)

2 quad, 2 pair

=A’B’C’D’ + A’B’C’D +A’B’CD + A’B’CD’ + A’B’CD + A’B’CD’ + A’BCD + A’BCD’ +


A’BCD + ABCD + A’B’C’D’ + AB’C’D’
=A’B’C’ (D’ + D) + A’B’C (D + D’) + A’B’C (D+D’) + A’BC (D+D’) + BCD(A’+A) +
B’C’D’ (A’+A)
= A’B’C’ + A’B’C + A’B’C + A’BC + BCD + B’C’D’
=A’B’ (C’+C) + A’C (B’+B) + BCD + B’C’D’
=A’B’ + A’C + BCD + B’C’D’
F(A, B, C, D) = A’B’ + A’C + BCD + B’C’D’

46. Write class clock has following members hours and minutes. Create member
functions to a) Initialize the data members b) Display time c) To convert hours and
minutes to minutes.

Page 14 of 16
Ans:
#include <iostream.h>
class Clock
{
Private:
int hour, minute;
public:
void initialize (int h, int m)
{
hour = h;
minute = m;
}
void display()
{
cout << "Time: " << hour << ":" << minute <<endl;
}
int convertToMinutes( )
{
return hour * 60 + minute;
}
};
void main( )
{
Clock c;
c.initialize(2, 30);
c.display();
int totalMinutes = c.convertToMinutes();
cout << "Total minutes: " << totalMinutes << std::endl;
}

47.
Emp_id Emp_name department Salary
E_101 Abhishek Marketing 45,000/-
E_102 Fanu IT 1,55,000/-
E_103 Karthik Account 65,000/-
E_104 Sharath IT 1,00,000/-
a) Write a SQL command to display all the record
b) Write a SQL command to count no of rows in a table
c) Write a SQL command to display maximum salary of an employee.

Page 15 of 16
d) Write a SQL command to display average salary.
e) Write a SQL command to display details of employee those who are working in
IT department.
Ans:

*****
Page 16 of 16

You might also like