Page 1
FOR MEGHALAYA CLASS 12 PREPARATION
MBOSE Class 12
Sample Question Paper
2027 Computer Science
EXAM YEAR TYPE SUBJECT
Meghalaya Class 12 2027 Sample Paper Computer Science
Notes · Sample Papers · Previous Year Papers · Mock Tests
Page 2
.
.co s e m
s em l a
a ag
Sample Question Paper
Subject: Computer Science
Class- XII
Full marks: 70 Time: 3 Hours
General Instructions:
m
om
1. This Question paper contains 37 questions.
. co
. c
2. All questions are compulsory. However, internal choices have been provided in some
e m
m
questions. Attempt only one of the choices in such questions.
e l as
as
3. The examination paper is divided into 5 sections: Sections A, B, C, D, E.
l ag
g
4. Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
a
5. Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
6. Section C consists of 4 questions (29 to 32). Each question carries 3 Marks.
7. Section D consists of 2 questions (33 to 34). Each question carries 4 Marks.
8. Section E consists of 3 questions (35 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.
om
Q No. Question Marks
Section – A (21 x 1 = 21 Marks)
. c
e m
1 State whether the following statement is True or False: 1
l as
“An item of a tuple can be easily modified like that of a list item.”
g statement?
2. What will be the output of theafollowing 1
print (256 % 2**2**3//2)
a) 256
b) 0
c) 2
d) 32
3 Identify the incorrect statement from the list of statements given below: 1
(a) print ( “a”, 10, end = “*”)
m
.co
(b) print ( “a”, 10, sep = “*”)
m
.co m
(c) print ( “a”, end = “*”,10)
m (d) print ( “a”*10)
s e
s e 4 Which of the following is a correct way to write a function header?
g la 1
g la (a) def area (a,b): a
a (b) def area (a= 10,b):
(c) def area1 (a=10,):
(d) def area (a,b=10):
5 An exception is caught in the_________ block and handles in except block. 1
6 Can a function modify a global variable without using the 1
“global” keyword? Explain.
om
1
. c
. c e m
m as
se
For more Question Papers, Sample Papers, Notes & Syllabus visit
gl
Page 1 of 8
Page 3
7 Considering the Python statement: 1
F= open ( “Poem.txt”), in which mode this file is being opened?
(a) Append mode
(b) Write mode
(c) Read mode
(d) Both read and write mode.
8 What is the main purpose of a stack data structure? 1
(a) To store elements in random order
(b) To store elements in FIFO ( First in First Out) order
(c) To store elements in LIFO ( Last In First Out) order
(d) To sort elements automatically.
9 Assertion (A): Stack underflow occurs when an attempt is made to delete 1
an element from an empty stack.
Reason (R): The pop( ) operation removes the topmost element of a stack.
(a) Both (A) and (R) are true and (R) is the correct explanation of (A)
(b) (A) is true but (R) is false
(c) Both (A) and (R) are true and (R) is not the correct explanation of
(A)
(d) (A) is false but (R) is true
10 How can you access an item in a dictionary? 1
11 Which of the following statement is incorrect in the context of binary files? 1
(a) The csv module is used for reading and writing objects in binary
files.
(b) The pickle module is used for reading and writing objects in binary
files.
(c) The load ( ) of the pickle module is used to read object.
(d) The dump( ) of the pickle module is used to write object.
12 Which keyword is used to force an exception? 1
(a) try
(b) except
(c) raise
(d) finally
13 Which of the following networking devices is used to regenerate and 1
transmit the weakened signal ahead?
(a) Hub
(b) Repeater
(c) Ethernet card
(d) Modem
14 Which of the following protocol is used for phone calls over the Internet? 1
(a) TCP/IP
(b) FTP
(c) HTTP
(d) VolP
15 Expand ARPANET 1
2
For more Question Papers, Sample Papers, Notes & Syllabus visit Page 2 of 8
Page 4
.
.co s e m
s em l a
a ag
16 While creating a table, which constraint does not allow insertion of 1
duplicate values in the table?
(a) UNIQUE
(b) NOT NULL
(c) DEFAULT
m
co
(d) None of the above
om .
17 1
. c
How is VARCHAR datatype different from CHAR datatype in MySQL?
e m
e m l as
as
18 To run an SQL query from within Python, you may use <cursor> ______
l
1
ag
g
method.
a
19 State True or False 1
In MySQL, the term used for referring a column in a table is attribute.
20 SELECT * FROM EMP WHERE EMP_ID>=10 AND EMP_ID <=20; is 1
equivalent to
(a) SELECT *FROM EMP WHERE EMP_ID BETWEEN 10 AND 20;
(b) SELECT *FROM EMP WHERE EMP_ID IN (10 AND 20);
m
.co
(c) SELECT *FROM EMP WHERE EMP_ID BETWEEN 10,20;
(d) SELECT *FROM EMP WHERE EMP_ID IN (10, 20);
21
e m 1
l as
Write an SQL statement to view the list of tables in the database ‘FINAL’.
agSection- B 7 x 2= 14
22 Differentiate between break and continue statement. 2
23 (A). What will be the output of the following code snippet? 2
d={}
d[1]=1
d[‘1’]=2
m
.co
s=0
m
.co
for x in d:
s= s+d[x]
e m
e m Print (s)
las
las OR
ag
ag (B) (Answer using Python built in methods/function only):
i. Write a statement to find the index of the first occurrence of the
1+1=2
substring “good” in a string named ‘review’.
ii. Write a statement to sort the element of Python list L1 in
descending order.
24 (A) Write a user-defined function to find simple interest by accepting 2
om
3
. c
. c e m
m as
se
For more Question Papers, Sample Papers, Notes & Syllabus visit
gl
Page 3 of 8
Page 5
principal, rate of interest and time period from user
OR
(B) Explain positional argument with example. 2
25 (A) Write a Python program to read a text file and count the number of 2
characters in the file.
OR
(B) Create a binary file “customer.dat” (cust_Id, cust_name, order_name).
And store any two records in the file “customer.dat”. 2
26 (A) Differentiate between read ( ) and readline ( ). 2
Or
(B) What is the difference between ‘r’ mode and ‘w’/? 2
27 (A) Write suitable commands to do the following in MYSQL. 1+1=2
i. View the table structure named ‘student’
ii. Create a database named ‘School’.
OR
(B) Write an SQL statement to drop a column named ‘Mobile_NO’ from 2
a table ‘student’.
28 (A) Define the following terms: 2
i. Switch
ii. Gateway
OR
(B) Differentiate between web server and web browser. 2
Section –C 3x3=9
29 (A) Write a Python function to read lines from a text file STORIES. TXT 3
and display those lines which doesn’t start with a vowel (A, E, I, O,
U) irrespective of their case.
OR
(B) Write a function DISPLAYWORDS ( ) in Python to read lines from a 3
text file POEM.TXT, and display those words which are less than 4
characters in length.
30 (A) What is an exception? What is the function of except block in 1+1+1
exception handling? Where does it appear in a program?
OR
(B) Predict the output of the following code for the function calls given in 1+1+1
i., ii. and iii. respectively.
def divide (x,y) :
try:
result=x/y
except ZeroDivisionError:
print(“Divisionally zero!”
else:
print ( “Result is”, result)
4
For more Question Papers, Sample Papers, Notes & Syllabus visit Page 4 of 8
Page 6
.
.co s e m
s em l a
a ag
finally:
print (“executing finally clause”)
i. divide (2,1) 1
ii. divide (2,0) 1
iii. divide (“2”, “1”) 1
m
co
31 (A) Consider the following postfix expression: 1½+1½
om .
(i) X: 5, 3, +, 2, *, 6, 9, 7, -, /, -
. c
(ii) AB + CD/ if A=2, B=3, C=4 and D=5
e m
em
Translate the expressions into infix notation and then evaluate it.
l as
l as OR
ag
ag
(B) Convert the following prefix expressions into infix expression:
(i) + ABC
1½+1½
(ii) − + A BCD
Section-D 4 x 4 = 16
32 (A) Convert X: ((A-B)* (D/E))/ (F*G*H) into postfix form showing stack 4
status after every step in tabular form.
OR
m
.co
(B) Write a function in Python, MakePush (Package) and MakePop
(Package) to add a new package and delete a package from a list of 4
e m
Package Description, considering them to act as push and pop
as
operations of the stack data structure.
l
ag
33 Consider the table SALES as given below: 4
Sales_id Customer_name Product Quantity_ Price
sold
5001 John Doe Laptop 5 50000
5002 Jane Smith Smartphone 10 30000
5003 Michael Lee Tablet 3 15000
5004 Sarah Brown Headphones 7 2000
5005 Emily Davis Smartwatch 8 8000
5006 David Smartwatch 3 16000
m
.co
5007 Mark Tablet 5 34000
m Predict the output of the following statements:
m .co s e m
la
i. SELECT * FROM Sales where product = ‘Tablet’;
s e g
la a
ii. SELECT sales-id, customer_name FROM Sales WHERE product
ag LIKE ‘S%’;
iii. SELECT COUNT (*) FROM Sales WHERE product in (‘Laptop’,
‘Tablet’)
iv. SELECT AVG (price) FROM Sales WHERE product = ‘Tablet’;
34 (A) Write SQL Statement for the following on the basis of the given table 4
Teacher:
No. Name Age Department Date of Salary Sex
om
5
. c
. c e m
m as
se
For more Question Papers, Sample Papers, Notes & Syllabus visit
gl
Page 5 of 8
Page 7
join
1 Jugal 34 Computer 10/01/97 12000 M
2 Sharmila 31 History 24/03/98 20000 F
3 Sandeep 32 Maths 12/12/96 30000 M
4 Sangeeta 35 History 01/07/99 40000 F
5 Rakesh 42 Maths 05/09/97 25000 M
i. To show all information about the teacher of History department
ii. To list the names of female teachers who are in Hindi department
iii. To list names of all teachers with their date of joining in ascending
order.
iv. To list details of all Teachers whose salary is from 25000 to 35000.
OR
(B) MYSQL database named ‘SchoolDB’ has a ‘student’ table which
contains the following attributes: 4
• Roll_no : integer
• Name: string
• Class : integer
• percentage : float
Note the following to establish connectivity between Python and
MYSQL :
• Username – root
• Password – tiger
• Host – localhost
Write a Python program to display the details of all the students
whose percentage is above 80.
35 Answer the following questions:
i. Differentiate between WHERE Clause and HAVING Clause of SQL 2
select statement.
ii. What is the purpose of ORDER BY Clause of SQL select statement? 1
iii. What is SQL join? 1
Section E 2 x 5 = 10
36 (A) Considering the following definition of dictionary ‘COMPANY’, write 5
a function in Python to search and display the content in a pickled file
COMPANY.DAT, where CompID key of the dictionary is matching
with the value ‘1005’.
COMPANY = {‘CompID’ : ____, ‘CName’: ____,
‘Turnover’:_____}
OR
6
For more Question Papers, Sample Papers, Notes & Syllabus visit Page 6 of 8
Page 8
.
.co s e m
s em l a
a ag
(B) Write a function that reads a CSV file and creates another CSV file 5
with the same content, but with a different delimiter.
37 XYZ Edu Services Ltd. is an educational organization. It is planning to set
up its India campus at Chennai with its head office at Delhi. The Chennai
Campus has 4 main buildings- ADMIN, ENGINEERING, BUSINESS and
m
co
MEDIA
. c om em .
em l as
l as ag
ag
You, as a network expert, have to suggest the best network related solutions
m
for their problems raised in (i) to (iv), keeping in mind that the distance
.co
between the buildings and other given parameters.
m
Shortest distances between various buildings:
e
l as
g
ADMIN TO ENGINEERING 55 m
a
ADMIN TO BUSINESS
ADMIN TO MEDIA
90m
50m
ENGINEERING TO BUSINESS 55m
ENGINEERING TO MEDIA 50m
BUSINESS TO MEDIA 45m
DELHI Head Office to CHENNAI 2175m
Campus
Number of computers installed at various buildings are as follows:
m
m ADMIN 110
.co
m .co ENGINEERING 75
s e m
e la
BUSINESS 40
las MEDIA 12
ag
ag DELHI Head Office 20
(i) Suggest the most appropriate location of the server inside the
CHENNAI campus (out of 4 buildings), to get the best connectivity 1
for maximum number of computers. Justify your answer
(ii) Suggest and draw the cable layout to efficiently connect various
buildings within CHENNAI campus for connecting the computers. 2
om
7
. c
. c e m
m as
se
For more Question Papers, Sample Papers, Notes & Syllabus visit
gl
Page 7 of 8
Page 9
(iii) Which hardware device will you suggest to be procured by the
campus to be installed to protect and control the internet uses within 1
the campus?
(iv) Which of the following will you suggest to establish the online face 1
to face communication between the people in Admin office of
CHENNAI campus and DELHI Head Office?
(a) Cable TV
(b) Email
(c) Video conferencing
(d) Text Chat
****
8
For more Question Papers, Sample Papers, Notes & Syllabus visit Page 8 of 8