CBSERanker

Loading

SAMPLE QUESTION PAPER (THEORY)CLASS: XII COMPUTER SCIENCE (083)

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
1State True or False: The Python interpreter handles logical errors during code execution.1
2Identify the output of the following code snippet:
text = "PYTHONPROGRAM"
text=text.replace('PY','#')
print(text)

(A) #THONPROGRAM
(B) ##THON#ROGRAM
(C) #THON#ROGRAM
(D) #YTHON#ROGRAM
1
3Which 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
4What is the output of the expression?
country='International'
print(country.split("n"))

(A) (‘I’, ‘ter’, ‘atio’, ‘al’)
(B) [‘I’, ‘ter’, ‘atio’, ‘al’]
(C) [‘I’,’n’,’ter’,’n’,’atio’,’n’,’al’]
(D) Error
1
5What will be the output of the following code snippet?
message= "World Peace"
print(message[-2::-2])
1
6What will be the output of the following code?
tuple1 = (1, 2, 3)
tuple2 = tuple1
tuple1 += (4,)
print(tuple1 == tuple2)

(A) True (B) False (C) tuple1 (D) Error
1
7If 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
8What 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
9If 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
10Fill in the missing statement:
file=open("example.txt","r")
data=file.read(100)
_______ #Move pointer to beginning
next_data=file.read(50)
file.close()
1
11State True or False: The finally block in Python is executed only if no exception occurs in the try block.1
12What will be the output?
c=10
def add():
global c
c=c+2
print(c,end='#')
add()
c=15
print(c,end='%')

(A) 12%15# (B) 15#12% (C) 12#15% (D) 12%15#
1
13Which SQL command can change the degree of an existing relation?1
14Output 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
15In which datatype value is padded with spaces to fit length?
(A) DATE (B) VARCHAR (C) FLOAT (D) CHAR
1
16Which aggregate function finds cardinality of a table?
(A) sum() (B) count() (C) avg() (D) max()
1
17Which protocol is used to transfer files over the Internet?
(A) HTTP (B) FTP (C) PPP (D) HTTPS
1
18Which device connects two networks with different protocols?
(A) Modem (B) Gateway (C) Switch (D) Repeater
1
19Which switching technique breaks data into packets for transmission allowing resource sharing?1
20Assertion (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
21Assertion (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.QuestionMarks
22Write two differences between a list and a tuple in Python with suitable examples.2
23Find and write the output of:
x="CyberSecurity"
print(x[2:10:2])
2
24Differentiate between Primary key and Foreign key in relational databases.2
25Explain the difference between DELETE and DROP commands in SQL with examples.2
26Expand the following terms: (i) URL (ii) VoIP2
27Differentiate between guided and unguided transmission media with examples.2
28Write one advantage and one disadvantage of cloud computing.2

Section C (3 × 3 = 9 Marks)

Q. No.QuestionMarks
29Write a Python function to count and display the frequency of each character in a given string.3
30Consider 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
31Explain the difference between hub and switch with neat diagrams.3

Section D (4 × 4 = 16 Marks)

Q. No.QuestionMarks
32Write a Python program to read a text file and count the number of vowels, consonants, digits, and special characters in it.4
33Write 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
34Write the differences between static and dynamic IP addressing. Explain with suitable examples.4
35Explain the importance of cybersecurity. Suggest four measures to protect against cyber threats.4

Section E (2 × 5 = 10 Marks)

Q. No.QuestionMarks
36Write 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
37Case 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

Leave a Reply

Your email address will not be published. Required fields are marked *