SAMPLE QUESTION PAPER (THEORY)CLASS: XII COMPUTER SCIENCE (083)
General Instructions
- This question paper contains 37 questions.
- All questions are compulsory. However, internal choices have been provided in some questions. Attempt only one of the choices in such questions.
- The paper is divided into 5 Sections: A, B, C, D, and E.
- Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
- Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
- Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
- Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
- Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
- All programming questions are to be answered using Python Language only.
- In case of MCQ, text of the correct answer should also be written.
Section A (21 × 1 = 21 Marks)
Q. No. | Question | Marks |
---|---|---|
1 | State True or False: The Python interpreter handles logical errors during code execution. | 1 |
2 | Identify the output of the following code snippet:text = "PYTHONPROGRAM" (A) #THONPROGRAM (B) ##THON#ROGRAM (C) #THON#ROGRAM (D) #YTHON#ROGRAM | 1 |
3 | Which of the following expressions evaluates to False? (A) not(True) and False (B) True or False (C) not(False and True) (D) True and not(False) | 1 |
4 | What is the output of the expression?country='International' (A) (‘I’, ‘ter’, ‘atio’, ‘al’) (B) [‘I’, ‘ter’, ‘atio’, ‘al’] (C) [‘I’,’n’,’ter’,’n’,’atio’,’n’,’al’] (D) Error | 1 |
5 | What will be the output of the following code snippet?message= "World Peace" | 1 |
6 | What will be the output of the following code?tuple1 = (1, 2, 3) (A) True (B) False (C) tuple1 (D) Error | 1 |
7 | If my_dict = {'apple': 10, 'banana': 20, 'orange': 30} , which of the following will raise an exception?(A) my_dict.get('orange') (B) print(my_dict['apple','banana']) (C) my_dict['apple']=20 (D) print(str(my_dict)) | 1 |
8 | What does list.remove(x) do?(A) Removes element at index x (B) Removes first occurrence of value x (C) Removes all occurrences of value x (D) Removes last occurrence of value x | 1 |
9 | If a table has one Primary key and two Alternate keys, how many Candidate keys will it have? (A) 1 (B) 2 (C) 3 (D) 4 | 1 |
10 | Fill in the missing statement:file=open("example.txt","r") | 1 |
11 | State True or False: The finally block in Python is executed only if no exception occurs in the try block. | 1 |
12 | What will be the output?c=10 (A) 12%15# (B) 15#12% (C) 12#15% (D) 12%15# | 1 |
13 | Which SQL command can change the degree of an existing relation? | 1 |
14 | Output of:SELECT * FROM products WHERE product_name LIKE 'App%'; (A) Details of products starting with ‘App’ (B) Details ending with ‘App’ (C) Names starting with ‘App’ (D) Names ending with ‘App’ | 1 |
15 | In which datatype value is padded with spaces to fit length? (A) DATE (B) VARCHAR (C) FLOAT (D) CHAR | 1 |
16 | Which aggregate function finds cardinality of a table? (A) sum() (B) count() (C) avg() (D) max() | 1 |
17 | Which protocol is used to transfer files over the Internet? (A) HTTP (B) FTP (C) PPP (D) HTTPS | 1 |
18 | Which device connects two networks with different protocols? (A) Modem (B) Gateway (C) Switch (D) Repeater | 1 |
19 | Which switching technique breaks data into packets for transmission allowing resource sharing? | 1 |
20 | Assertion (A): Positional arguments in Python must be passed in defined order. Reason (R): Because Python assigns default values to positional arguments. (A) Both true & R explains A (B) Both true but R not explanation (C) A true, R false (D) A false, R true | 1 |
21 | Assertion (A): A SELECT command can have both WHERE and HAVING clauses. Reason (R): Both are interchangeable since they check conditions. (A) Both true & R explains A (B) Both true but R not explanation (C) A true, R false (D) A false, R true | 1 |
Section B (7 × 2 = 14 Marks)
Q. No. | Question | Marks |
---|---|---|
22 | Write two differences between a list and a tuple in Python with suitable examples. | 2 |
23 | Find and write the output of:x="CyberSecurity" | 2 |
24 | Differentiate between Primary key and Foreign key in relational databases. | 2 |
25 | Explain the difference between DELETE and DROP commands in SQL with examples. | 2 |
26 | Expand the following terms: (i) URL (ii) VoIP | 2 |
27 | Differentiate between guided and unguided transmission media with examples. | 2 |
28 | Write one advantage and one disadvantage of cloud computing. | 2 |
Section C (3 × 3 = 9 Marks)
Q. No. | Question | Marks |
---|---|---|
29 | Write a Python function to count and display the frequency of each character in a given string. | 3 |
30 | Consider the following table “Student”: Write SQL queries for: (i) Display details of all students whose age is greater than 18. (ii) Count the number of students enrolled in ‘Science’. (iii) Display names of students in descending order of marks. | 3 |
31 | Explain the difference between hub and switch with neat diagrams. | 3 |
Section D (4 × 4 = 16 Marks)
Q. No. | Question | Marks |
---|---|---|
32 | Write a Python program to read a text file and count the number of vowels, consonants, digits, and special characters in it. | 4 |
33 | Write SQL commands for: (i) Add a new column “Email” to the table Employee. (ii) Update salary of employees in department ‘HR’ by 10%. (iii) Delete all employees whose experience is less than 2 years. (iv) Display distinct departments from the table Employee. | 4 |
34 | Write the differences between static and dynamic IP addressing. Explain with suitable examples. | 4 |
35 | Explain the importance of cybersecurity. Suggest four measures to protect against cyber threats. | 4 |
Section E (2 × 5 = 10 Marks)
Q. No. | Question | Marks |
---|---|---|
36 | Write a Python program to create a CSV file “students.csv” with fields RollNo, Name, Age, and Marks. Also, write a program to read the contents of this file and display records of students having Marks greater than 75. | 5 |
37 | Case Study: ABC School wants to maintain a database of library books. The table “Books” contains columns: BookID, Title, Author, Publisher, and Price. (i) Write SQL query to display all books by publisher ‘Oxford’. (ii) Write SQL query to increase price of all books by 5%. (iii) Write SQL query to display Title and Author of books priced above 500. (iv) Write SQL query to delete all books published before 2010. (v) Write SQL query to count the number of books by each author. | 5 |