Computer Science (083)
CLASS XII
     Time: 3 Hours                                                                            Max. Marks: 70
     General Instructions:
     1.   This question paper contains 37 questions.
     2.   All questions are compulsory. However, internal choices have been provided in some questions. Attempt
          only one of the choices in such questions
     3.   The paper is divided into 5 Sections- A, B, C, D and E.
     4.   Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
     5.   Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
     6.   Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
     7.   Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
     8.   Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
     9.   All programming questions are to be answered using Python Language only.
     10. In case of MCQ, text of the correct answer should also be written.
                                               SECTION A
1.   State True or False
     “A tuple is a immutable data type.”
2.   The alternate to math.pow() function is______operator.
     (a) **                                      (b) c $
     (c) + =                                           (d) /
3.   Two tables are joined using a common field known as ______.
     (a) Alternate key                                 (b) Foreign key
     (c) Candidate key                                 (d) None of these
4.   To print all elements of tuple in reverse order using______.
     (a) [: – 1]                                       (b) [: : – 1]
     (c) [1 : : ]                                      (d) [: : 1]
5.   Given : s=“Rajkumar@gmail.com”. What will be the output of print(s[2: :2])?
     (a) ‘juagalcm’                                    (b) ‘jua@galcm’
     (c) ‘ajua@galcm’’                                 (d) ‘jua@gmalcm’’
6.   What will be the output of the following code snippet?
     sentence = “Learning Python”
     print(sentence[8:15])
7.   Which of the following Python functions do not require importing of a module?
     (a) type()                                       (b) input()
     (c) sqrt()                                       (d) Both (a) and (b)
8.   Which of the following modes open a text file, such that the new data is written in it keeping the existing
     contents ?
     (a) r+                                           (b) rw+
     (c) w+                                           (d) a
9.   The_____clause with the update command specifies the attribute to be modified.
     (a) FIELD                                        (b) ATTRIBUTE
     (c) CHANGE                                       (d) SET
10. Complete the code by filling in the blank with the appropriate line to move the file pointer:
    file = open(“output.txt”, “r”)
    data = file.read(20)
    file.seek(5)      # Move the file pointer to position 5
    next_data = file.read(10)
    file.close()
11. State whether the following statement is True or False:
     The `raise` statement in Python is used to manually trigger an exception.
12. Which type of network is typically used for a single site, covering a small range around an individual, such
    as in a home or office setup?
     (a) DSL                                          (b) RAM
     (c) WAN                                          (d) PAN
13. Determine the output of the following code:
    s1 = ‘Hello’
    s2 = ‘World’
    s = s1 + s2
    print(s)
    (a) Hello World                                   (b) HelloWorld
     (c) ‘Hellow’ ‘World’                             (d) Error
14. The_____clause with GROUP BY, can filter groups from the query output.
     (a) WHERE                                        (b) FILTER
     (c) HAVING                                       (d) CHECK
15. Given a list L= [6,12,9,40,2,1]. Which of the following statements will arrange the list in reverse order
    (a) L.arrange()                                   (b) L.sort()
    (c) L.sort(reverse=True)                          (d) L.sort(reverse=False)
16. Which method returns the next row from the result set as a tuple?
    (a) fetchone( )                                   (b) fetchmany( )
    (c) fetchall( )                                   (d) rowcount
17. An alternate key can be
    (a) only 1 in a table.                            (b) a table can have maximum 2 alternate keys.
    (c) a table can have at most 3 alternate keys.    (d) multiple in a relation.
18. Which SQL category provides statements for manipulating database objects?
    (a) DDL                                           (b) DML
    (c) DCL                                           (d) TCL
19. Which attribute is used to return access mode with that file was opened?
    (a) file.mode                                     (b) mode.file
    (c) file*mode                                     (d) None of these
Directions : (Q. Nos. 20 and 21) are Assertion and Reason based questions.
20. Assertion (A) : A python function can return more than one value to the calling function.
    Reason (R) : The return statement takes only a list as parameter.
    (a) Both A and R are true and R is the correct explanation of A.
    (b) Both A and R are true but R is not the correct explanation of A.
    (c) A is true but R is false.
    (d) A is false but R is true.
21. Assertion (A) : While opening a binary file the mode may not be specified.
    Reason (R) : The open function for file opening by default takes the mode parameter as ‘rb’ for binary files,
    if no mode is specified.
    (a) Both A and R are true and R is the correct explanation of A.
    (b) Both A and R are true but R is not the correct explanation of A.
    (c) A is true but R is false.
    (d) A is false but R is true.
                                                SECTION B
22. Find the output of the following code :
    i = 1
    while(i < 5):
         print(i)
         i = i * 2
23. (a) Correct the error if any in the following statement.
        (i) a + 5 = b
        (ii) 1 = 2b + c * d
        (iii) name = Aryan
        (iv) a = 20
              print a;
    (b) Evaluate the following expression
        If a = b = 10, c = 5
        a = b*3//4 + c//4 + 4– b + 5//6
24. Provide one appropriate example of a URL and a domain name.
                                                          o
    Is it possible to use a URL to access a webpage? If so, how?
25. Explain the UPDATE command in SQL, including its basic syntax and an example.
26. (a) Write any two characteristics of IP address.
    (b) What is VoIP?
27. Write the one example of following terms.
    (i) Identifier                                     (ii) Punctuator
    (iii) Keyword                                      (iv) Constant
                                                          o
    What will be the output of the following code?
    a, b = 8, 4
    x, y = a + b, b - 2
    z = x - y
    print(“x:”, x, “y:”, y, “z:”, z)
28. Expand the following abbreviation :
    (i) SQL                                            (ii) DML
    (iii) DDL                                          (iv) TCL
                                                          o
    Mention two characteristics of SQL.
                                               SECTION C
29. Write a Python function that accepts a sentence and counts the occurrences of the words “is” and “was”.
    Example
    Input: “It is what it is. The situation was complex and still is.”
    Output:
    Number of “is”: 3
    Number of “was”: 1
                                                          o
    Write a definition of a function that takes input a sentence and display the list of words that start with a
    lowercase vowel and list of words that start with a uppercase vowel separately.
    Example
    Input : A quick black elephant enters Into a jungle.
    Output
    List of words starting with lowercase vowels [‘elephant’, ‘enters’, ‘a’]
    List of words starting with uppercase vowels [‘A’, ‘Into’]
30. How can you create a Python function to repeatedly accept person names and add them to a list, ensuring
    that each name only contains letters, spaces, and periods (.) without any digits?
                                                          o
    Find the final contents of a stack that encounters the following tokens.
    Assume that an operand is pushed to stack and a binary operator pops two operands from stack and pushes
    the result to the stack.
    100,8,3,*,50,2,+,+,*
31. Write a program that calculates the sum and mean of a series of numbers entered by the user.
                                                         o
    A user-defined method to open a text file “para.txt” and write its contents to another file fter removing the
    3rd line
    def Func():
    		 with open (‘Para.txt’, ‘r’) as f:
    				 l=f.readlines()
    		 f.close()
    		 print(l)
    		 del l[3]
    		 print(l)
    		 f=open (‘Para.txt’, ‘w’)
    		 f...........
    		 f.close()
    (a) Which module needs to be imported to use operating system functions like rename() and remove().
    (b) Write the function name to open a text file.
    (c) Fill the blank as marked in above code.
                                                 SECTION D
32. (a) Write a Python program to find maximum and minimum elements in a tuple.
   (b) Consider the table MobileStock with following fields
   		 M_Id, M_Name, M_Qty, M_Supplier
       Write the Python code to fetch all records with fields M_Id, M_Name and M_Supplier from database
       Mobile.
                                                        o
   (a) Which of the following are invalid names and why?
         (i) Paidlnterest		         (ii) S-num
         (iii) Percent		            (iv) 123
   (b) Write the steps for Database connectivity with short explanation of each step.
33. What does tell() method do?
   (a) AddRegistration() :To accept more student registration data and store them to the binary file keeping
       the existing registration data.
         A Binary file “Registration.dat” exists storing details of students who have been registeredfor CBSE
         board exams. The file stores following data of students :
         RegnNo      StudName class No of subjects
   (b) CountRegistrations() : Display count of registrations using the functions.
34. Consider the following tables PRODUCT and CLIENT
                                                 TABLE : PRODUCT
    PID                 ProductName                             Manufacturer                   Price
    TP01                Powder                                  LAK                            40
    FW05                Face Cleaner                            ABC                            45
    BS01                Liquid Soap                             ABC                            55
    SH06                Dove Shampoo                            XYZ                            120
    FW12                Face Wash                               XYZ                            95
                                                  TABLE : CLIENT
    C_ID                ClientName                            City                      P_ID
    01                  Cosmetic Shop                         Delhi                     FW05
    06                  Total Health                          Mumbai                    BS01
    12                  Life care                             Delhi                     SH06
    15                  Pretty Store                          Delhi                     FW12
    16                  Dreams                                Bengaluru                 TP01
   (a) To display the ClientName, City from table CLIENT and ProductName and Price from table PRODUCT,
       with their corresponding matching P_ID.
   (b) Write SQL queries for statements (i) to (iv)
          (i) To display the details of those Clients, whose City is Delhi.
          (ii) To display the details of products, whose Price is in the range of 50 to 100 (both values included).
          (iii) To display product name and their manufacturer whose Price is more than 100.
          (iv) To display client name for those whose product id is FW12.
35. Write SQL commands (i) to (iv) for the following tables :
                                                 TABLE : STUDENT
     S NO       NAME                     STREAM                     FEES          AGE          SEX        AID
     1          RAJAN KUMAR              COMPUTER                   750.00        17           M          A1
     2          DEEPA JENEJA             COMPUTER                   750.00        18           F          A2
     3          KESHAR MEHRA             BIOLOGY                    500.00        16           M          A2
     4          SACHIN SINGH             ENG. DR                    350.00        18           M          A1
     5          PRACHI                   ECONOMICS                  300.00        19           F          A3
     6          NISHA ARORA              COMPUTER                   750.00        15           F          A3
     7          NEEL KUMAR               ECONOMICS                  300.00        16           M          A1
     8          SARIKA VASWANI           BIOLOGY                    500.00        15           F          A1
     TABLE: ADDRESS
     AID                     City
     Al                      Jaipur
     A2                      Bengaluru
     A3                      Delhi
          (i) List the name of all the students, who have taken stream as COMPUTER.
          (ii) To count the number of female students.
          (iii) To display the number of students stream wise.
       (iv) To display names of the students with corresponding cities.
                                                        o
    Write the command to display all the tables in the database.
                                                 SECTION E
36. Expertia Professional Global (EPG) is an online corporate training provider specializing in IT-related
    courses. The company is establishing a new campus in Mumbai, and as a network expert, you are tasked
    with analyzing the physical layout of various buildings and determining the optimal number of computers
    to be installed in each location. During the planning phase, you must provide the most effective solutions
    for the queries (i) to (v) that have been raised by the company..
    Physical locations of the buildings of EPG
    Building to building distance (in metre)
     From                           To                             Distance
     Administrative Building        Finance Building               60
     Administrative Building        Faculty Studio Building        120
     Finance Building               Faculty Studio Building        70
    Expected computers to be installed in each building
     Buildings                           Computers
     Administrative Building             20
     Finance Building                    40
     Faculty Studio Building             120
    (i) Suggest the most appropriate building, where EPG should plan to install the server.
    (ii) Suggest the most appropriate building to building cable layout to connect all three buildings for efficient
         communication.
    (iii) Which type of network out of the following is formed by connection the computers of these three
          buildings?
        (a) LAN       (b) MAN     (c) WAN
    (iv) Write the difference between LAN and MAN.
    (v) Expand the following
        (a) WAN         (b) MAN
37. Consider the following table ORDERS :
                                                TABLE : ORDERS
    O_Id               Order Date                        OrderPrice                  Customer
    1                  2008/11/12                        1000                        Hansen
    2                  2008/10/23                        1600                        Nilsen
    3                  2008/09/02                        700                         Hansen
    4                  2008/09/03                        300                         Hansen
    5                  2008/08/30                        2000                        Jensen
    6                  2008/10/04                        100                         Nilsen
   (i) Write a statement to create the above table.
   (ii) Write a command to change the width of Customer column to varchar(30)
   (iii) Write statements to :
        (a) Display the field names, their type , size and constraints .
        (b) Display details of orders where orderprice is in the range 500 to 1500
                                             (Option for part iii only)
                                             o
        (a) Write a command to increase orderprice of all orders by 15%.
        (b) Name the constraint that will restrict both NULL and DUPLICATE values in the O_Id field.