CBSE Class 12 Computer Science Question Paper with Solutions

Contents show

cbse class 12 computer science question paper with solutions 2021

CBSE Class 12 Computer Science Question Paper

               Practice Test Paper – 2

time: three hours                       max marks: 70                                                            

          All questions are compulsory. Question paper is divided into 4 sections, A,B,C and D
           Section A : unit 1, Section B : unit 2, Section c : unit 3, Section D : unit 4



(a) what data type  is object below ?                       1

                    L = 1,23,’hello’ , 1

   (i) list       (ii) dictionary        (iii) array      (iv) tuple

(b) Below are some segments of code, each with a part colored. Indicate the data type of each colored part by choosing the correct type of data from the following type.               1

(i) int   (ii) float   (iii) bool  (iv) str  (v) function  (vi) list of int  (vii) list of str

(i) L = [ ‘Hiya’, ‘Zoya’, ‘preet’ ]
(ii) if n%2 == 0 :

(c) Which python libraries?modules need to be imported to use following functions ?                   1

     (i) float()                    (ii) randint()

(d) Find the errors in the following code and write the correct code.                                2

      (i) underline the corrections
     (ii) write the reason/error next to it in comment form.

             FOR x in [ 2,5,8 ]
                          n = n + x

(e) Predict the outputs of the following programs :             2

          x = 10
          y = 0
           while x > y :
                        x = x – 1
                        y = y + 1

(f) Determine the output of the following :                  3

               def printit(list1) :
                       m = n = list[0]
                       for a in list1 :
                               if a < n :
                                      n = a
                                if a > m :
                                       m = a
                      print(“Biggest”, m, “smallest”, n)
                 list = [2, 13, 11, 15, 6]

(g) What are possible outcomes executed from the following code? Also specify the maximum and minimum values that can be assigned to variable NUMBER.     2

             STRING = “CBSEONLINE”
              NUMBER = random.randint(0,3)
              N = 9
              while STRING[N] != ‘L’ :
                          print (STRING[N] + ‘#’ ,end = ‘ ‘)
                          NUMBER = NUMBER + 1
                          N = N – 1

      (i) ES#NE#IO#  (ii) LE#NO#ON#      (iii) NS#IE#LO#     (iv)   EC#NB#IS#


(a) What is the difference between read ( ) and readlines( ) function?                 1

(b) what is the difference between (30) and (30), ?            1

(c) consider square numbers defined as follows :                1

                  computer(1) = 1
                    computer (N) = computer(N-1) + 2N – 1

according to this definition, what is computer(3) ?

(a) computer (3) =computer (2) + computer(1)                                                 (c)computer(3) =computer(2) – 2*3 + 1 
(b) computer  (3) =computer(2) + 2*3 -1                                                             (d)computer(3) =computer(3) + 2*3 -1

(d) write a line of code that writes ” Hello world!” to a file opened with file object myfile.           1

(e) Predict the output.                    1

               [ x + y for x in ‘ball’ for y in ‘ boy ‘]            

(f) what are the advantages of saving data in : (i) binary form (ii) text form ?                 2

(g) write code to plot two lines for two series whose X and Y ranges are given below.           2

  •  Make sure to show two lines with different widths and color
  •  Title should be Two Series Info’

Series 1 : x = 5,8,10,                         y = 12,16,6
Series 2 : x = 6,9,11                            y = 6,15,7


convert the following infix expression to its equivalent postix expression showing stack contents for the conversion : A+B* (C-D)/ E

(h) write code to print just the last line of a text file  ”data.txt”. Write a program that read this text file and print only the numbers or digits from the file.        2


 Write code to print just the last line of a text file  “data.txt” .
(i) Write a python program to calculate the value of  ‘a’ to the power of ‘b’ .                  3


 Write a program to calculate the sum of the digits of a non-negative integer.

(j) Write a program to insert or delete an element from a queue depending upon user’s choice. The elements are not shifted after insertion or deletion.            4


 write a program to insert or delete an element from queue depending upon user’s choice.



(a) which of these is the correct definition of a router?          1

  (i) Forwards data packets along a network
  (ii) Corrects errors that are found in data packets
  (iii) A type of transmission media that provides the greatest band/width 
  (iv) A server within a network

(b) The unique address of web page on the web is called ______ .         1

(c) A stand alone computer may also be refereed to as host. (True/False)          1

(d) which of the following is not a type of cloud ?          1

     (a) Private    (b) Public     (c) Protected      (d) Hybrid

(e) write full forms for  (i) POP (ii) SMTP   (iii) DNS   (iv) NIC     2

(f) The wireless network employ strategies to avoid collisions. Why can’t they detect collisions ?          2

(g) Identify the term/protocol/device from the given description.        3

(i) A high frequency wave whose characteristics are alerted to superimpose message information.
(ii) Technique of changing the characteristics of an analog signal to carry digital information.
(iii) Too many data packets rushing to a node in a network, than it can handle.

(h) Granada Consultants are setting up a secured network for their office campus at Faridabad for their day to day office and  web-based activities. They are planning to have connectivity between 3 buildings and the head office situated in kolkata. Answer the question (i) to (iv) after going through the building positions in the campus and other details, which are given below :                4

Distance between various buildings :
cbse class 12 computer science question paper
cbse class 12 computer science question paper
(i) Suggest the most suitable place (i.e., block) to house the server of this organization. Also give a reason to justify your suggested location.

(ii) what type of network will be formed if all buildings are connected ?

(iii) suggested the placement of the following devices with justification :
                 (a) switch             (b) Repeater

(iv) The organization is planning to provide a high speed link with its head office situated in the KOLKATA using a wired connection. which of the following cables will be most suitable for this job ?

      (a) Optical Fiber     (b) Co-axial Cable    (c) Ethernet Cable



(a) Consider the table with structure as :          1

                         Student( ID, name, dept name, tot_cred)

         In the above table, which attribute will form the primary key ?

                 (a) Name        (b) Dept           (c) Total_credits    (d) ID

(b) Consider following SQL statement. What type of statements is this ?                   1

            SELECT * FROM employee
       (a) DML     (b) DDL         (c) DCL     (d) Integrity constraint

(c) whic of the following keywirds will you use in following query to display the unique values of the column dept_name ?             1

             SELECT _______ dept_name FROM company ;
        (a) All           (ii) From        (c) Distinct    (d) Name

(d) consider the following query :          1

               SELECT name FROM class WHERE subject ______ NULL ;                     

         (a) All     (b) From    (c) IS    (d) IS NOT

(e) what are DDL and DML ?           2


 What is a relation ? What is the difference between a tuple and attribute ?

(f) what is the utility of following files ?         2

            (a)          (b)

(g) consider the following tables GAMES and PLAYER and answer the following parts of this question :       3

cbse class 12 computer science question paper
  Give the output of the following SQL queries :


   (ii) SELECT MAX(ScheduleDate), MIN(ScheduleDate) From GAMES ;

   (iii) SELECT Name, GameName FROM GAMES G, PLAYER P

           WHERE G.GCODE = P.GCode AND G.PrizeMoney > 10000 ; 

(h) Consider the following tables SENDER and RECIPIENT. Write SQL commands for the following statements.       4

cbse class 12 computer science question paper
(i) To display the names of all Senders from Mumbai

(ii) To display the RecID, SenderName, Senderaddress, RecName, RecAddress for every Recipient

(iii) to display Recipient details in ascending order of RecName

(iv) To display number of Recipients from each city


               (cbse class 12 computer science question paper with solutions)


(a) what is meant by  ‘open source’ software ?            1

         (i) Software owned by an organisation, you may need to buy a license for
         (ii) Freely available, constantly upgraded by users. No fee.

(b) which of the following is not done by cyber criminals ?        1

       (a) Unauthorized account access                  (b) Mass attack using Trojans as botnets
       (c) Email spoofing and spamming                 (d) Report vulnerability in any system

(c) what is digital property ? What are the threats to digital properties ?         2

(d) Describe the terms freeware and open source software. Write examples of one Proprietary and one OSS software.          2

(e) Explain Phishing and how to Prevent it ?           2

(f) Are public domain software open source software ? How are these two similar or different ?            2

cbse class 12 computer science question paper with solutions

for more sample paper