(Computer Science) CBSE Class XII Important Questions Computer Science (2008)
Disclaimer: This website is NOT associated with CBSE, for official website of CBSE visit - www.cbse.gov.in
Computer Science : CBSE Class XII Important Questions Computer Science (2008)
Chapter 10 – Linked Lists, Stacks and Queues
Q. 36. Differentiate between a FIFO list and LIFO list.
Ans:
A FIFO (First In First Out) list processes its elements in first come first
served basis.
A LIFO (Last In First Out) list is processed in LIFO manner i.e., elements that
entered last are removed first of all.
Q. 37. Transform the following expression to prefix and postfix form:
(A + B * C – D)/E * F
Ans:
i)
Postfix form
(A + B * C – D)/E * F = ((A + (B * C)) – D)/ (E * F)
= ((A + (BC*)) – D)/ (EF *)
= ((ABC * +) – D)/ (EF *)
= ((ABC * + D –))/EF*
= ABC * + D – EF */
ii) Prefix
form
(A + B * C – D)/E * F = ((A + (B * C)) – D)/ (E * F)
= ((A + (*BC)) – D)/(*EF)
= ((+A * BC) – D)/(*EF)
= (- + A * BCD)/(*EF)
= / - + A * BCD * EF
Q. 38. Transform the following expressions to infix form:
-
+ - ABC
-
+ A – BC
Ans:
-
+(A – B)C = (A – B) + C
-
+ A(B – C) = A + (B – C)
Q. 39. Evaluate the following postfix expression using a stack and show the contents of the stack after execution of each operation
5, 6, 9, +, 80, 5, *, -, /
Ans: Scan from left to right
Operator Scanned |
Stack Content |
5 |
5 |
6 |
5, 6 |
9 |
5, 6, 9 |
+ |
5, 15 |
80 |
5, 15, 80 |
5 |
5, 15, 80, 5 |
* |
5, 15, 400 |
- |
5, -385 |
/ |
-1/77 |
The result is: -1/77
Q. 40. Give the necessary declaration of a linked implemented stack containing integer type numbers; also write a user defined function in C++ to pop a number from this stack.
Ans:
struct stack
{
int info;
stack *next;
}*top, *ptr;
void pop( )
{
if(!top)
{
cout<<”underflow \n”;
exit(1);
}
else
{
cout<<top->info;
ptr = top;
top = top -> next;
ptr -> next = null;
delete ptr;
}
}
Chapter 11 – Database Concepts
Q. 41. What is a relation? What is the difference between a tuple and an attribute?
Ans: A relation is a table having atomic values, unique rows and unordered rows and columns. A row in a relation is known as tuple whereas a column of a table is known as an attribute.
Q. 42. Define the following terms:
-
Degree
-
Cardinality
Ans:
-
Degree: The number of attributes (columns) in a relation determine the degree of a relation.
-
Cardinality: The number of tuples (rows) in a relation is called the cardinality of the relation.
Chapter 12 – Structured Query Language
Q. 43. What are DDL and DML?
Ans:
The DDL provides statements for the creation and deletion of tables and indexes.
The DML provides statements to enter, update, delete data and perform complex
queries on these tables.
Q. 44. Given the following tables for a database LIBRARY:
Table: Books
Book_Id |
Book_Name |
Author_Name |
Publishers |
Price |
Type |
Qty |
F001 |
The tears |
William Hopkins |
First Publ |
750 |
Fiction |
10 |
F002 |
Thunderbolts |
Anna Roberts |
First Publ |
700 |
Fiction |
5 |
T001 |
My First C++ |
Brian & Brooke |
EPB |
250 |
Text |
10 |
T002 |
C++ Brainworks |
A.W.Rossaine |
TDH |
325 |
Text |
5 |
C001 |
Fast Cook |
Lata Kapoor |
EPB |
350 |
Cookery |
8 |
Table: Issued
Book_Id |
Quantity _Issued |
F001 |
3 |
T001 |
1 |
C001 |
5 |
Write SQL queries for (a) to (f):
-
To show Book name, Author Name, and Price of books of EPB publishers.
-
To list the names of books of fiction type.
-
To display the names and price of the books in descending order of their price.
-
To increase the price of al books of first publ by 50.
-
To display the Book_Id, Book_Name, and Quantity_Issued for all books which have been issued.
-
To insert a new row in the table Issued having the following data: “F002”, 4.
Give the output of the following queries based on the above tables:
-
SELECT COUNT (DISTINCT Publishers) FROM Books.
-
SELECT SUM (Price) FROM Books WHERE Quantity>5
-
SELECT Book_Name, Author_Name FROM Books WHERE Price<500
-
SELECT COUNT (*) FROM Books.
Ans:
-
SELECT Book_Name, Author_Name, Price
FROM Books WHERE Publishers = “EPB”; -
SELECT Book_Name FROM Books WHERE Type = “Fiction”;
-
SELECT Book_Name, Price FROM Books ORDER BY Price DESC;
-
UPDATE Book SET Price = Price + 50 WHERE Publishers = “First Publ”;
-
SELECT Books.Book_Id, Book_Name, Quantity_Issued FROM Books, Issued WHERE Books.Book_Id = Issued.Book_Id;
-
INSERT INTO issued VALUES(“F002”, 4);
-
i) 3
ii) 1350
iii) My First C++ Brian & Brooke
C++ Brainworks A.W.Rossaine
Fast Cook Lata Kapoor
iv) 5
Chapter 13 – Boolean Algebra
Q. 45. State the principle of duality in Boolean Algebra and give the dual of the Boolean expression (X + Y) . (X’ + Z’) . (Y + Z)
Ans: Principle of Duality states that from every Boolean relation, another boolean relation can be derived by
-
Changing each OR sign to AND and vice versa
-
Replacing each 1 by 0 and vice versa.
The
new derived relation is known as the dual of the original relation.
Dual of (X + Y) . (X’ + Z’) . (Y + Z) is X.Y + X’.Z’ + Y.Z
Q. 46. Seven inverters are cascaded one after another. What is the output if the input is 1?
Ans: 0.
Q. 47. Why are NAND and NOR gates called Universal Gates?
Ans: NAND and NOR gates are less expensive and easier to design. Also other functions (NOT, AND, OR) can easily be implemented using NAND/NOR gates.
Q. 48. Obtain a simplified form for the following Boolean Expression using Karnaugh’s Map:
F(a, b, c, d) = ∑(0, 1, 2, 4, 5, 7, 8, 9, 10, 11, 14).
Ans:
1 |
1 |
0 |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
1 |
Quad 1 = a’c’ , Quad 2 = ab’ , Pair 1 is a’bd, Pair 2 is b’cd’ , Pair 3 is acd’
The simplified form is: a’c’ + ab’ + a’bd + b’cd’ + acd’
Q. 49. State and prove Associative Law with the help of Truth Table.
Chapter 14 – Communication and Network Concepts
Q .50. What is meant by Network Topology?
Ans: The pattern of interconnection of nodes in a network is called the network topology. Major topologies are:
-
Star
-
Bus
-
Ring or Circular
-
Tree
-
Graph
Q. 51. What are Bridges? How do they differ from Repeaters?
Ans: Bridge is a device that links two networks together. Bridges differ from repeaters in their capability of deciding whether a particular message is to be communicated on the other side or not where as a repeater just amplifies the signal and pass it to other side.
Q. 52. Give the full form for the following:
-
MODEM
-
FM
-
AM
-
NFS
-
FTP
Ans:
-
Modulator Demodulator
-
Frequency Modulation
-
Amplitude Modulation
-
Network File Server
-
File Transfer Protocol.
<<Previous