Midterm KA

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

SECOND PUC MID TERM EXAMINATION, OCTOBER 2024

SUB: COMPUTER SCIENCE (41)


PART — A
Answer all the questions. Each question carries one mark:
15 X 1 = 15
I. Select the correct answer from the given choices. Repeated answers are not considered
1)____________is a high-speed memory placed between RAM and CPU
a) Internal memory b) External memory
c) Cache memory d) Register .
2 ) AG P st a n d s f or _ __ __ ___ __ __
a) Advanced Graphic part b) Advanced Graphic Port
c) Accelerated Graphic part d) Accelerated Graphic Port
3) Idempotent law states that
a ) X +X =X b ) X • X =X c) Both a and b d) 1+X=1
4) If result of any logical statement or expression is always true or one then it is
a) Tautology b) Fall ac y c ) Mi n t erm d) Ma x te rm
5) 0 + X is equal to
a) 0 b) 1 c) X d)
6) Identify universal gate
a) OR Gate b) XOR Gate c) AND Gate d) NAND Gate
7) What is the output of the two inputs XNOR gate for the inputs X =1, Y = 0
a) 1 b) 0 c) 1, 0 d) 1. 1
8) Statement (A): Array is collection of homogeneous elements.
Statement (B): Array elements are counted from 0 to N-1
a) Both A and B are True b) A is False and B is True
c) A is True and B is False d) Both A and B are False
9)______________ is an example for non-liner data Structure.
a) Stack b) Queue c) Linked list d) Tree
10) Examine the following program segment. identify the
error
class example
{
private : int x;
}
void main ( )
{
example p;
}
a) error due to incorrect object declaration
b) error due to semicolon missing after class definition
c) error due to missing of public access specifier
d) error due to invalid initialization of object

11) Default Access specifier is


a) Private b ) P u bl i c c) Protected d ) Hi d de n
12) Statement (A) : Friend function is a non-member function
Statement (B): It has full access right to access the private and protected members
of the class.
a) A is true and B is False
b) A is False and B is True
c) Both A and B are True
d) Both A and B are False
13) Which of the following functions arc compact function calls
a) overloaded b) Inline c) Friend d) All of the above
14) Zero arguments constructor is ____________
a ) De f aul t b ) Pa ra m e t e ri z e d c ) Copy d) Ove rl oa de d
15) The symbol used with destructor
a) • b):: c)~ d) *

II. Fill in the blanks choosing the appropriate word voids from those given its the
brackets: 5x1=5
(Searching, Size, Nodes, Push, Update, Top)
16) One of operation performed on primitive data Structure is UPDATE.
1 7 ) S E A R C H I N G is the process of finding the location of the element is a liner
array.
18) Operation to insert an element into a stock is called PUSH
19) SIZE operation returns the number of elements in the queue.
20) A linked list is a liner collection of data elements called NODES

PART — B
Answer any FOUR questions. Each question carries TWO marks: 4x2=8
21) P r ove that 𝒙 + 𝒙 ̅=𝟏
̅
A: i f X = 0 t he n L HS = 𝒙 + 𝒙
= 0 + 1
= 1 [by OR re la t i on]
= RHS
̅
i f X = 1 t he n L HS = 𝒙 + 𝒙
= 1 + 0
= 1 [by OR re la t i on]
= RHS
22) Define min term and max term.
A: Minterm is a product of all the literals (with or without the bar) within
the logic system.
Maxterm is a sum of all the literals (with or without the bar) within the
logic System.
23) What is principle of duality? Give an example.
Principal of Duality states that a Boolean Relation can be derived by
another Boolean Relation.
Rules : 1. Changing each OR sign(+) to an AND sign (.)
2. Changing each AND sign(.) to an OR sign(+)
3. Changing each 0 by 1 and each 1 by 0.
Examples: 1. (X + 1) . (Y + 0) can be X.0 + Y.1
24) Write logic diagram and truth table of NOT gate

25) 'Realize OR, AND gates usi ng NOR Gate.

26) Define a) Constructor, b) Destructors


A constructor is a special member function of a class with the same name
as that of the class that is used to initialize the objects of a class
automatically
A destructor is a special member function that will be executed
automatically when an object is destroyed. It will have the same name as
that of class name but preceded by a tilde ( ~ ).
27) Mention any two features of parameterized constructor .
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

PART — C •
IV. Answer any FOUR questions. Each question carries THREE marks:4x 3 = 12
28) What is a motherboard? explain any two types of motherboard.
It is a large Printed Circuit Board ( PCB ) having many chips, ports,
controllers and other electronic components mounted on it.Types(any 2)
XT Motherboard : XT stands for extended Technology.
These are all old model motherboard.
Consists of LIF ( Low Insertion Force ) old model processor socket,
DIMM RAM slots, ISA slots, 12 pin power connector and no ports.
Examples : Pentium-I, Pentium-II, Pentium-MMX.
AT Motherboard : AT stands for Advanced Technology.
Consists of PGA ( Pin Grid Array ) processor socket, SDRAM
slots, ISA and PCI slots and 20 pin power connector.
Examples : Pentium-III processors.
29) Give the features of USB por t.
USB ( Universal Serial Bus ) Port :
USB is a plug-and -play interface between a computer and add -on devices
i.e, a new device can be added to the computer without adding an adapter
card or even turning the computer off.
USB port give s a single, standardized, easy -to-use way to connect a
variety of peripherals to a computer.
These devices include printers, scanners, digital cameras, web cameras,
speakers etc.
USB support s a data speed of 12 megabits per second, supporting up to
127 devices

30) Brie fl y e xpl ai n any thre e type s of RAM .


SRAM[Sta tic RAM] : • Sta tic RAM reta ins store d i nforma ti on a s l ong a s
t he power suppl y is on. • St ati c RAM do not nee d re fre shi ng ci rc uit ry. •
Sta tic RAM i s costlie r a nd c onsume s m ore powe r.
• St atic RAM i s ve ry fa st a nd ea si er to use .
SDRAM[Sync hronous Dynami c RAM ]: • Thi s i s sync hroni se d wi th the
system cl ock he nce it knows when t he next c ycl e i s com ing, and ha s t he
data re ady when the CPU re que st s. • T hi s incre a se s effic ie ncy by
reduc ing CPU waiti ng ti me.
DDR-SDRAM [ Double Da ta Rate Synchronous Dyna mic RAM ] : DDR -
SDRAM i nt erfac e ma ke s hi ghe r tra nsfer rate s possi ble by a llowing t he
t ra nsfer of data on bot h t he ri sing a nd fa lli ng edge s of t he c loc k signal to
l owe r t he c lock freque nc y. • Di fferent t ype s of DDR -SDRAM a re DDR1,
DDR2, DDR3.

31) Expand UP S. Expl ai n the type s of UP S.


An UPS i s a power suppl y tha t i ncl ude s a bat te ry t o ma intai n powe r i n
t he eve nt of a power fa ilure or a ny elec trica l probl em s l ike power li ne
problem s, power outa ge s, unde r volta ge or li ghte ni ng.
T he re a re t wo type s of UPS : 1. Offl ine UPS 2. Onli ne UPS
1. Offl ine UPS or Sta ndby UPS: In offli ne UPS t he input c urre nt i s
di rect ly connecte d to the de vi ce. T he UPS circuit a lways monit ors t he
vol ta ge l eve l i n t he mai ns, a nd i f t here i s a vol tage drop or mai ns fail ure,
i t swit che s on t he i nve rte r t o give AC power to the de vi c e from t he
i nverte r unt il t he mai ns supply returns t o normal . T he swi tch ove r t ime
from AC t o i nvert er AC i s le ss tha n fi ve m ill i sec onds so t ha t t he
funct ioni ng of t he c om pute r i s not a ffecte d.
2. Onli ne UPS : In onl ine UPS the i nverter i s di rec tl y c onnec te d t o t he
device and i t i s al wa ys on t o gi ve t he re quired current t o t he de vic e. If
powe r fai l s , t he ba tte ry ba ckup ci rc uit swi tc he s on a nd take s t he loa d.
Onli ne UPS a voids mom ent ary powe r l apses by c onti nuously provi di ng
powe r from it s own inve rte r , e ve n when the power li ne i s funct ioni ng
properly. Onl ine UPS i s m ore e fficie nt and c ostl y t ha n t he offline UPS.

32) Write an algorithm to insert an element into array.


Algorithm : A is an array with N elements. ITEM is the element to be inserted
in the position P.
Step 1 : for I = N-1 down to P
A[I+1] = A[I]
End of for
Step 2 : A [P] = ITEM
Step 3 : N=N+1
Step 4 : Exit
33) Give any three applications of queue.
(any 3)
1. Serving requests on a single shared resource, like a printer, CPU task
scheduling etc.
2. In real life, Call Center phone systems will use Queues, to hold people
calling them in an order, until a service representative is free. 3. Handling
of interrupts in real -time systems. The interrupts are handled in the same
order as they arrive, First come first server.
4. Round Robin Technique
5. Simulation
6. Printer Server routines
7. Multi Programming Platform Systems

34) Explai n the types of linked list.


PART — D
V. Answer any FOUR questions. Each question carries five marks: 4 x 5 = 20
35) State and prove Demorgan’s theorem using truth table method.

36) Explain memory representation of stack using Arrays.


STATIC REPRESENTATION USING ARRAYS :
1. 1-D array is used to hold the elements of the stack.
2. Variable “top” keeps track of “Topmost” Element in the stack.
3. “MAXSTK” is used as Constant which gives maximum size of Stack .
37) Write an algorithm to delete an element from the queue.
Step 1 : If FRONT = -1 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 = -1
REAR = -1
Else
FRONT = FRONT + 1 [Increment Front Pointer]
Step 3 : RETURN

38) Explain any five characteristics of object-oriented programming


language.
1. Objects. • An object is a collection of data members and associated
member functions.
2. class : A class is a collection of objects that have identical properties,
common behavior and shared relationship
3. Data Abstraction: • Data Abstraction refers to the process of representing
essential features without including background details or explanations.
4. Data Encapsulation: • The wrapping of data and functions into a single
unit (class) is called data encapsulation
5. Inheritance: • Inheritance is the process by which one object can acquire
and use the properties of another object
6. Overloading
7. Polymorphism
8. Dynamic Binding
9. Message Passing (any 5).

39) What is function overloading? Write an example program for


overloaded functions.
Function Overloading means two or more functions have same name, but
differ in the number of arguments or data types of arguments .
#include <iostream.h>
#include<conio.h>
class funoverloaded
{ public: int area (int l, int b)
{ return (l * b); }
float area (float r)
{ return (3.14 * r * r); }
float area (float b, float h)
{ return (0.5 * b * h); }
};
void main ()
{ funoverloaded f;
clrscr ();
cout<<”area of rectangle”<< f.area(4,6)<<endl;
cout<<”area of circle”<< f.area(4)<<endl;
cout<<”area of triangle”<< f.area(4.6,6.7)<<endl;
getch():
}

40) Write the rules for naming a constructor function.


1. A constructor is a member function of a class with the same name as that of
the class.
2. A constructor is defined like other member functions of a class. It can be
defined either inside the class definition or outside the class definition.
3. Since, the constructor is called automatically by the system, there is no
return type for constructors (not even void).
4. A constructor should be declared in public section.
5. A constructor is invoked automatically when objects are created. Constructor
can have default arguments.
6. It is not possible to refer to the address of the constructors.
7. The constructors make implicit calls to the operators new and delete when
memory allocations are required.

41) With syntax and example, explain default constructor.


Syntax: Classname :: classname() { }
Example: student () { }
Program to show the initialization of an object using default constructor
#include <iostream.h>
#include<conio.h>
class X
{ private: int a, b;
public: X ()
{ a = 10; b = 20; }
void display ()
{ cout<< a <<setw(5)<< b<< endl; }
};
void main ()
{ X obj1, obj2;
obj1.display ();
obj2.display ();
}

PART — E
VI. Answer any TWO questions. Each question carries five marks: 2 x 5 = 10
42) Reduce F(A,B,C,D)= E(0, 1, 2, 3, 4, 6, 8, 10, 11, I2, 14) using
Karnaugh map.
43) Write an example program to find the sum of two numbers using
the concept of member function inside the class definition.
44) Define a class named Triangle with following criteria.
1) Data me mbe r s: base , hei ght
2) Member functions: getdata ( ) and putdata ( )
3) Define member functions outside the class to input and output
base and height of a triangle.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy