(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:

  1. + - ABC

  2. + A – BC

Ans:

  1. +(A – B)C = (A – B) + C

  2. + 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:

  1. Degree

  2. Cardinality

Ans:

  1. Degree: The number of attributes (columns) in a relation determine the degree of a relation.

  2. 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):

  1. To show Book name, Author Name, and Price of books of EPB publishers.

  2. To list the names of books of fiction type.

  3. To display the names and price of the books in descending order of their price.

  4. To increase the price of al books of first publ by 50.

  5. To display the Book_Id, Book_Name, and Quantity_Issued for all books which have been issued.

  6. 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:

  1. SELECT COUNT (DISTINCT Publishers) FROM Books.

  2. SELECT SUM (Price) FROM Books WHERE Quantity>5

  3. SELECT Book_Name, Author_Name FROM Books WHERE Price<500

  4. SELECT COUNT (*) FROM Books.

Ans:

  1. SELECT Book_Name, Author_Name, Price
    FROM Books WHERE Publishers = “EPB”;

  2. SELECT Book_Name FROM Books WHERE Type = “Fiction”;

  3. SELECT Book_Name, Price FROM Books ORDER BY Price DESC;

  4. UPDATE Book SET Price = Price + 50 WHERE Publishers = “First Publ”;

  5. SELECT Books.Book_Id, Book_Name, Quantity_Issued FROM Books, Issued WHERE Books.Book_Id = Issued.Book_Id;

  6. INSERT INTO issued VALUES(“F002”, 4);

  7. 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

    1. Changing each OR sign to AND and vice versa

    2. 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:

  1. Star

  2. Bus

  3. Ring or Circular

  4. Tree

  5. 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:

  1. MODEM

  2. FM

  3. AM

  4. NFS

  5. FTP

Ans:

  1.  Modulator Demodulator 

  2. Frequency Modulation

  3. Amplitude Modulation

  4. Network File Server

  5. File Transfer Protocol.

 

 

<<Previous