Class 12 CBSE COMPUTER SCIENCE Sample Question Paper
- Categories Uncategorized
Class XII
COMPUTER SCIENCE – NEW (083)
SAMPLE QUESTION PAPER (2021 – 22)
Max Marks: 70
Time: 3 hrs
General Instructions:
- This question paper contains two parts A and B. Each part is compulsory.
- Both Part A and Part B have choices.
- Part-A has 2 sections:
- Section – I is short answer questions, to be answered in one word or one line.
- Section – II has two case studies questions. Each case study has 4 case-based subparts. An examinee is to attempt any 4 out of the 5 subparts.
- Part – B is Descriptive Paper.
- Part- B has three sections
- Section-I is short answer questions of 2 marks each in which two questions have internal options.
- Section-II is long answer questions of 3 marks each in which two questions have internal options.
- Section-III is very long answer questions of 5 marks each in which one question has question has internal option.
Part-A
Section-I
Select the most appropriate option out of the options given for each question. Attempt any 15 questions from question no 1 to 21.
1 . Identify the Python data types?
a. “And” b. {‘name’: 26} c. [26, 24] d. (‘My’, ‘data’)
2 . A twisted pair cable is a pair of_________ wires that are twisted together to improve electromagnetic capability
3 . Rita wants to display a column “TYPE” in table ACCOUNT. Write SQL statement to show which command she should use to select the column and give it an alias “EVENT TYPE”?
4 . Which is the default sorting order used in ORDER BY clause?
5 . Name the Python Library modules which need to be imported to invoke the following functions :
i. writerow( )
ii. dump ( )
6 . _____ is the amount of data transmitted via a given communications Channel in a given unit of time.
7 . What is the value of c after executing these statements?
c = 7//4
a. 3 b. 1 c. 1.75 d. The statement is incorrect
8 . Which command is used to view a table structure?
9 . What is an Alternate Key?
10 . Give 2 mutable and 2 immutable types in Python?
11 . ___________ is a process of storing data into files and allows it to perform various tasks such as read, write, append, search and modify in files.
12 . Which constraint makes sure that all values in a column satisfy a certain criteria?
13 . Write an SQL query to print details of workers excluding FIRST_NAME, “Ronit” and “Nitin” from WORKER table.
14 . Which one of these is output of these Python commands?
L = [1,3,5,3,1]
print (L.index(3),L.count(3)))
a) 12
b) 1 2
c) 22
d) 2 2
15 . What is the output of these Python commands?
A = (1,2,(3,4),5)
print (len(A), A[2])
16 . __________command will test the connectivity between two host
17 . What is the output of the following commands?
score =20
while score > 1:
score=score//2-1
print(score,end=’ ‘)
18 . Ronit downloaded a harmless looking game from internet. Soon his computer started abnormal functioning. Sometimes it would restart by itself and sometimes it would stop different applications running on it. Which of the following options out of (i) to (iv), would have caused the malfunctioning of the computer?
a. Trojan Horse
b. Spam Mail
c. Computer Bacteria
d. Hardware breakdown
19 . To read 4th line from text file, which of the following statement is true?
a. dt = f.readlines();print(dt[3])
b. dt=f.read(4) ;print(dt[3])
c. dt=f.readline(4);print(dt[3])
d. All of these
20 . Which protocol is used for transferring files from one computer to another?
21 . Stack is _____ data structure.
a. FIFO
b. LIFO
c. POP
d. None of above.
Section-II
Both the Case study based questions(22 & 23) are compulsory. Attempt any 4 sub parts from each question. Each sub question carries 1 mark.
22 .Observe the following table carefully and Answer the following questions.
Table: Store
Item code | Item | Qty | Rate |
---|---|---|---|
10 | Gel pen classic | 1150 | 25 |
11 | Sharpener | 1500 | 10 |
12 | Ball pen 0.5 | 1600 | 12 |
13 | Eraser | 1600 | 5 |
15 | Ball pen 0.25 | 800 | 20 |
a. In the above table, can we have Qty as primary key?
b. What is the cardinality and degree of the above table?
c. Write a query to display the structure of table store from Mall Database.
d. Give the output of following query.
Select distinct Item from Store;
e. If we want to display maximum rate in store from Mall Database. Which command will be use the following:
a. Select min(rent) from resort;
b. Select minimum(rent) from mall;
c. Select min(rent) from mall;
d. Select minimum(rent) from resort;
23 . Nyra has a branch1.csv file which has the name, class and section of students. She receives a branch2.csv which has similar details of students in second branch. She is asked to add the details of branch2,csv into branch1.csv. As a programmer, help her to successfully execute the given task.
__a__ csv
file = open('branch1.csv', __b__ , newline="");
writer = csv. __c__ (file)
with open('branch2.csv','r') as csvfile:
data = csv.reader(csvfile)
for row in data:
writer.writerow(__d__)
file. __e__ ()
a. Name the command she should use to include csv library.
b. In which mode she should open the file to add data into the file
c. Name the csv method which returns the object responsible for converting user’s data into delimited strings
d. Fill in the blank with the information that needs to be written to csvfile.
e. Fill in the blank to close the file.
Part-B
Section-I
24 . Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.
c=dict{}
n=input("enter total number")
i=1
while I <= n:
a=input("enter place")
b=input("enter number")
c[a]=b
i=i+1
print("place","\t","number")
for i in c:
print i + "\t"+ c[i]
25 . Give full forms of the following?
1. VOIP, 2. ARPANET, 3. SMTP, 4. RFID
26 . Define String in Python?
27 . Find and write the output of the following python code:
a=['Cat','Dog','cat','Dog']
def manip(f1):
animal={}
for index in f1:
if index in animal:
animal [index] += 1
else:
animal[index] =1
return(animal)
ret = manip(a)
print (ret)
print (len(ret))
28 . What is the difference between packet switching and circuit switching techniques?
29 . Which option is NOT the possible outcome(s) executed from the following code?
import random
def main():
p = "MY PROGRAM"
i = 0
while p[i] != "R":
l = random.randint(0,3) + 5
print (p[l],end ="_")
i += 1
main()
30 . Define the following terms :
i. Relation
ii. Tuple
iii. Attribute
iv. Domain
31 . What is join in SQL? What is difference between Inner-join and Full join?
32 . Evaluate the following postfix expression using stack and show the contents of stack after execution of each expression
120, 45, 20, + , 25, 15, – , + , *
33 . Differentiate between CHAR and VARCHAR datatypes in SQL?
Section-II
34 . Write a python function to sum the sequence given below. Take the input n from the user.
35 . Write a function program to do a binary search in an array.
36 .Write a program to count the number of upper-case alphabets present in a text file “PYTHON.TXT”
Or
Write a function which takes in an input file and output file. It copies all lines which starts with vowels from the input file to output file.
37 . Consider the following tables RESORT and OWNEDBY and answer questions.
Table : RESORTRCODE PLACE RENT TYPE STARTDATE R001 GOA 15000 5 STAR 12-JAN-02 R002 HIMACHAL 9000 4 STAR 20-DEC-07 R003 KERALA 12500 5 STAR 10-MAR-06 R004 HIMACHAL 10500 2 STAR 25-NOV-05 R005 GUJARAT 8000 7 STAR 01-JAN-03 R006 GOA 18000 4 STAR 30-MAR-08 R007 ORISSA 7500 2 STAR 12-APR-99 R008 KERALA 11000 5 STAR 03-MAR-03 R009 HIMACHAL 9000 2 STAR 15-OCT-08 R010 GOA 13000 5 STAR 12-APR-06
Table : OWNEDBYPlace Owner Goa Raj Resorts Kerala KTDC Himachal HTDC Gujarat MAHINDRA RESORTS Orissa OTDC
Give output for the following SQL queries:
1. Select min(rent) from resort where place = ‘KERALA’;
2. Select type, start date from resort where type ‘2 STAR’ orderby startdate,
3. Select place, owner from ownedby where place like “%a”;
Section III
38 . Write answer of the following
Simply Coding is a computer institute aimed to uplift the standard of computer knowledge in the society. It is planning to setup its training centres in multiple towns and villages pan India with its head offices in the nearest cities. They have created a model of their network with A city, C Town and 3 Villages as given.
As a network consultant, you have to suggest the best network related solution for their issues/problems raised in (i) to (iv) keeping in mind the distance between various locations and given parameters.
Shortest distance between various locations:
Village 1, 2, 3 to C Town | 1 to 2 km |
Distance between the villages | 3 – 4 km |
City Head Office to C Town | 50 km |
Number of computers installed at various locations are as follows:
C Town | 50 |
Village 1 | 10 |
Village 2 | 15 |
Village 3 | 8 |
City Head Office | 25 |
1. Suggest the most appropriate location of the SERVER in the HUB (out of the 4 locations), to get the best and effective connectivity. Justify your answer.
2. Suggest the best wired medium for network.
3. Draw the cable layout (location to location) to efficiently connect various locations within the HUB
4. Which hardware device will you suggest to connect all the computers within each location of HUB?
5. Which server/protocol will be most helpful to conduct live interaction of Experts from Head office and people at HUB locations?
39 . Consider the following tables EMPLOYEE and SALGRADE and answer this question:
Table : EmployeeEcode Name Design SGrade DOJ DOB 101 Abdul Ahmad Executive S03 23-Mar-2003 13-Jan-1980 102 Ravi Chander Head-IT S02 12-feb-2010 22-Jul-1987 103 John Ken Receptionist S03 24-Jun-2009 24-Feb-1983 105 Nazar Ameen GM S02 11-Aug-2006 03-Mar-1984 108 Priyam Sen CEO S01 29-Dec-2004 19-Jan-1982
Table : SalGradeSgrade Salary HRA S01 56000 18000 S02 32000 12000 S03 24000 8000
Write SQL commands for the following statements
i. To display the details of all employees in descending order of DOJ.
ii. To display NAME and DESIGN of those employees, whose salary grade is either S02 or S03.
iii. To display the content of all EMPLOYEE table, whose DOJ is in between ’09-Feb-2006′ and ’08- Aug-2009′.
iv. To display the details of all employee who has joined before 1985 from employee table.
v. To add a new row with the following data:
109, ‘Harish Roy’, ‘Head-IT’, ‘S02, ’09-
Sep-2007′, ’21-Apr-1983’
40 . Write a function writefile() to write numbers into a binary file and another function readfile() to read and print the same.
OR
A binary file “phonebook.dat” has structure [Name, PhoneNo].
i. Write a user defined function append_record() to input data for a record and add to phonebook.dat .
ii. Write a function search_record() in Python which takes in a name and prints only those records which matches that name.