0% found this document useful (0 votes)
44 views5 pages

12 CS Board Set 4 QP

The document is a sample question paper for Computer Science with 70 marks and 3 hours duration. It contains general instructions for the paper format and sections. Section A contains 18 multiple choice questions carrying 1 mark each. Section B contains 7 very short answer questions carrying 2 marks each. Section C contains 5 short answer questions carrying 3 marks each. Section D contains 3 long answer questions carrying 5 marks each. Section E contains 2 questions carrying 4 marks each. Programming questions are to be answered using Python language only.

Uploaded by

kousalya.kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views5 pages

12 CS Board Set 4 QP

The document is a sample question paper for Computer Science with 70 marks and 3 hours duration. It contains general instructions for the paper format and sections. Section A contains 18 multiple choice questions carrying 1 mark each. Section B contains 7 very short answer questions carrying 2 marks each. Section C contains 5 short answer questions carrying 3 marks each. Section D contains 3 long answer questions carrying 5 marks each. Section E contains 2 questions carrying 4 marks each. Programming questions are to be answered using Python language only.

Uploaded by

kousalya.kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

7 Given the following dictionaries 1

Class: XII Session: 2022-23 dict_exam={"Exam":"AISSCE", "Year":2023}


dict_result={"Total":500, "Pass_Marks":165}
Computer Science (083) Which statement will merge the contents of both dictionaries?
a. dict_exam.update(dict_result)
b. dict_exam + dict_result
Sample Question Paper (Theory) c. dict_exam.add(dict_result)
--------------------------------------------------------------------------------------------------------------------------------------------------- d. dict_exam.merge(dict_result)
8 Consider the given expression 1
Maximum Marks: 70 Time Allowed: 3 hours False, True, NOT, OR, True, False,AND,OR
Which of the following is the correct output if expression is evaluated?
General Instructions: (A) True (B) False (C) None (D) Null
9 Give the output of the following 1
1. This question paper contains five sections, Section A to E. x=3
x+=x-x
2. All questions are compulsory.
print(x)
3. Section A have 18 questions carrying 01 mark each.
(A) 3 (B) 0 (C) 2 (D) 1
4. Section B has 07 Very Short Answer type questions carrying 02 marks each. 10 Bluetooth is an example of 1
(A) LAN (B) WAN (C) PAN (D) Virtual private network
5. Section C has 05 Short Answer type questions carrying 03 marks each. 11 State true or false 1
6. Section D has 03 Long Answer type questions carrying 05 marks each. “ Immutable data type are those that can never change their values “
12 Which of the following statement(s) would give an error after executing the 1
7. Section E has 02 questions carrying 04 marks each. One choice is given in Q35 against part c only. following code?
x=50 # Statement 1
8. All programming questions are to be answered using Python Language only. Def func(x) # Statement 2
x=2 # Statement 3
SECTION A
func(x) # Statement 4
1 In a Python program, a control structure: 1 print(x) # Statement 5
(A) Defines program-specific data structre
(B) Directs the order of Execution of statements in the program (A) Statement 1 (B) Statement 3 & 4 (C) statement 4 (D) Statement 2
(C) Dictates what happens before the program starts and after it terminates
(D) None of above
13 which of the following is the correct output for executing the following python 1
2 Find the invalid Identifier from the following: 1 statement?
(A) Myname print(5 + 3**2 / 2)
(B) 1Myname (A) 32 (B) 8.0 (C) 9.5 (D) 32.0
(C) My_name
1
(D) Myname2
14 Which topology is based on a central node which acts as a hub ?
3 Which of the following is invalid method for fetching the records from database 1 (A) Bus topology (B) Star topology
within Python ? (C) Tree topology (D) Hybrid Topology
(A) fetchone()
(B) fetchmany()
1
(C) fetchall()
15 To establish a connection between Python and SQL database, what of the following
(D) fetchmulti()
statement is connecting database server?
(A) importMySQLdb
4 What is the default EOL Character in python ? 1 (B) MySQLdb.connect
(A) \n (B) \t (C) \l (D) \h (C) db.cursor
(D) None of the above
5 This method is used to load (unpickling) data from binary file 1
(A) load() (B) dump() (C) seek() (D) tell() 16 _______function place the pointer at the specified position of the file pointer by in 1
an opening file.
6 Identify the valid arithmetic operator in python 1
(A) ? (B) < (C) ** (D) and (A) seek() b) tell() c) read() d) load()
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as 23 What are the different switching techniques in networking ? 2
(a) Both A and R are true and R is the correct explanation for A 24 (a) Given is a Python string declaration: 2
(b) Both A and R are true and R is not the correct explanation for A title="## ICC CRICKET T20 W’Cup 2022@@"
(c) A is True but R is False Write the output of: print(title[::-1])
(d) A is false but R is True
17 Assertion (A):- If the arguments in a function call statement match the number 1 (b) Write the output of the code given below:
and order of arguments as defined in the function definition, such arguments my_dict = {"name": "Aman", "age": 26}
are called positional arguments. my_dict['age'] = 27
Reasoning (R):- During a function call, the argument list first contains default my_dict['address'] = "Delhi"
argument(s) followed by positional argument(s). print(my_dict.items())
18 Assertion (A): CSV (Comma Separated Values) is a file format for data storage 1 25 Differentiate between WHERE and HAVING clause. 2
which looks like a text file. SECTION C
Reason (R): The information is organized with one record on each line and each 26 a) Consider the following tables – student and games: 1+2
field is separated by comma. .
SECTION B Table : student
19 What possible outputs(s) are expected to be displayed on screen at the time of 2 Rollno Name
execution of the program from the following code? Also specify the maximum 1 Rohan
values that can be assigned to each of the variables Lower and Upper. 2 Jaya
import random 3 Teena
AR=[20,30,40,50,60,70];
Lower=random.randint(1,3) table : games
Upper=random.randint(2,4) gameno gname
for K in range(Lower, Upper+1): 10 Football
print (AR[K],end="#") 11 Lawn Tennis
(A) 10#40#70# What will be the output of following statement ?
(B) 30#40#50#
(C) 50#60#70# Select Name, gname from student, games ;
(D) 40#50#70#
20 (a) Write the full form of the following 2 b) write the output of queries i) to iv) based on the table, LOANS given below:
i) ARPANET ii) WiMax Table : LOANS
(b) Name the different guided media for data transmission. AccNo Cust_Name Loan_Amount Instalments Int_Rate Start_Date Interest
21 Predict the output of the following code 2
def Alter(M,N=50): 1 R.K.Gupta 300000 36 12.00 2009-07-19 1200
M=M+N 2 S.P.Sharma 500000 48 10.00 2008-03-22 1800
N=M-N 3 K.P. Jain 300000 36 NULL 2007-03-08 1600
print(M,"@",N) 4 M.P.Yadav 800000 60 10.00 2008-12-06 2250
return(M) 5 S.P.Sinha 200000 36 12.50 2010-01-03 4500
A=200 6 P.Sharma 700000 60 12.50 2008-06-05 3500
B=100 7 K.S. Dhall 500000 48 NULL 2008-03-05 3800
A=Alter(A,B)
print(A,"#",B) i) Select sum(Loan_Amount) from LOANS where Int_Rate > 10 ;
B=Alter(B) ii) Select max(Interest) from LOANS;
print(A,"@",B) iii) Select count(*) from LOANS where Int_Rate is NULL;
22 Rewrite the following code in Python after removing all syntax error(s). Underline 2 iv) Select * from LONAS GROUP BY Interest HAVING Instalments >= 10;
each correction done in the code.
30=Value 27 Write a user – defined function countH() in Python that displays the number of lines 3
for VAL in range(0,Value) . starting with ‘H’ in the file ‘Para.txt”. Example , if the file contains:
If val%4=0: Whose woods these are I think I know.
print (VAL*4) His house is in the village though;
Else val%5==0: He will not see me stopping here
print (VAL+3) To watch his woods fill up with snow.
Output: The line count should be 2. 30 Write a program to implement a Stack for these book-details(book no, book name). 3
OR . That is , now each item node of the stack contains two types of information – a book
Write a function countmy() in Python to read the text file “DATA.TXT” and count no, and its name. Just implement PUSH and Display Operations create a Push() and
the number of times “my” occurs in the file. For example , if the file “DATA.TXT” Display() functions:
contains –
“This is my website. I have displayed my preference in the CHOICE section.” The OR
countmy( ) function should display the output as: Write a function in Python MakePush(Package) and MakePop(Package) to add a
“my occurs 2 times” new Package and delete a Package from a List of package description, considering
28 Write the output of the SQL queries i) to iv) based on the relations SHOP and 2+1 them to act as puch and pop operations of the Stack data structure.
. ACCESSORIES given below:
SECTION D
Table: SHOP 31 “Vidya for All” is an educational NGO. It is setting up its new campus at Jaipur for 5
. its web-based activities. The campus has four building as shown in diagram below:
Id SName Area
S01 ABC Computronics CP
S02 All Infotech Media GK II
S03 Tech Shopee CP
S04 Geek Tenco Soft Nehru Place
S05 Hitech Tech Store Nehru Place

Main Resource
Table : ACCESSORIES
Building
Building
No Name Price Id
A01 Motherboard 12000 S01
A02 Hard Disk 5000 S01
A03 Keyboard 500 S02
A04 Mouse 300 S01
A05 Motherboard 13000 S02 Training Accounts
A06 Keyboard 400 S03 Building Building
A07 LCD 6000 S04
T08 LCD 5500 S05
T09 Mouse 350 S05
T010 Hard Disk 450 S03 Center to Center distance between various building as per architectural drawings (in
meters is as follows:
i) Select distinct Name from ACCESSORIES where Price > = 5000; Main Building to Resource Building 120m
ii) Select Area, count(*) from SHOP group by Area; Main Building to Training Building 40m
iii) Select count(distinct Area) from SHOP; Main Building to Accounts building 135m
iv) Select A.Name , A.Price from ACCESSORIES A, SHOP S
Resource Building to Training Building 125m
where A.Id =S.Id and Price >=12000;
Resource Building to Account Building 45m
Training building to Account Building 110m
b) write the command to create a database employee.
Expected number of computers in each building is as follows:
29 Write a python function is_even_num(l), where l is the list of elements passed as 3
Main Building 15
. arguments to the function. The function return even numbers from a given list:
Resource Building 25
Sample List : [1,2,3,4,5,6,7,8,9] Training Building 250
Accounts Building 10
Expected Result:[2,4,6,8]
i)Suggest the layout of connection between the building.
ii)Suggest the most suitable (i.e. building) to house the server of this NGO. Also
provide a suitable reason for your suggestion.
iii)Suggest the placement of the following devices with justification:
a)Repeater b)Hub / Switch b)Consider the following code which is doing following ,
iv) The NGO is planning to connect its International office situated in delhi . which updating the records of employees by increasing the salary by Rs.1000 of all those
out of the following wired communication links will you suggest for a very high employees who are getting less than Rs. 80000.
speed connectivity ? Write the following missing statements:
a) Telephone Analog line b) Optical Fiber iii)Ethernet Cable i)statement1
v)Suggest the protocol to be used to update website of their organization from ii)statement2
Training Building. iii)statement3
32 a) Predict the output of the following code fragment ? 2+3
. def check(n1=1, n2=2): import _______.connector #statement1
n1=n1+n2 db1=mysql.connector.connect(host=”localhost”, user=”root”,password=””,
n2+=1 databse=”company”)
print(n1,n2) cursor = _______________ #statement2
check ( ) sql=”update emp set salary = salary + 1000 where salary <80000;”
check(2,1)
try:
b.) study the database ‘company’ that has a table ‘Emp’ that stores IDs of cursor._______________ #statement3
employees. Code contain the connectivity to retrieve data, one record at a time, for bd1.commit( )
employees with IDs less than 10. except:
Write the missing statements db1.rollback( )
i)Statement1 .
ii)Statement2 bd1.close( )
iii)Statement3
33 Write a user defined function to perform read and write operations onto a 5
import MYSQLdb as mycon . ‘student.csv’ file having fields roll number, name, stream and marks.
try:
db=______.connect(host=”localhost”, user =”root”, passwd=” ”, Or
database =”company”) ##write missing part in statement1
cursor = _________________#missing Statement2 Write the difference between text and csv file ?
sql=”select * from Emp where id < 10”) Ranjan kumar of class 12 want to write a program on csv file “user.csv” he wants to
number_of_rows=cursor.execute(sql) store user id and password in user.csv files.
print(cursor.fetchone()) Example he want to write following data where first is user id and second is
db._______ ##missing statement3 password in the file :
except mycon.DataError as e: “Arjun”, “123@456”
print(“DataError”) “Arunima”, “123#453”
print(e) “Shyam”, “12&1234”

OR Create following functions:


a)Predict the output of the following code given below: addCsvFile( ):- which will add user id and password in “user.csv” file.
def fun(s): defReadCsvFile( ):- which will read the user id and password form “user.csv”file.
k=len(s) SECTION E
m=” “ 34 Consider the following table STORE: 1+1+2
for i in range(0,k): . Table : STORE
if(s[i].isupper()): ItemNo ItemName Scode Qunatity
m=m+s[i].lower( ) 2005 Sharpener Classic 23 60
elif s[i].isalpha( ): 2003 Ball Pen 0.25 22 50
m=m+s[i].upper( ) 2002 Get Pen Premium 21 150
else: 2006 Get Pen Classic 22 220
m = m + ‘bb’ 2001 Eraser Small 22 220
print(m) 2004 Eraser Big 22 110
fun(‘school2@com’)
Based on the above STOR Table and data in it answer the following questions:

a) Identify the attribute best suitable for Primary key.


b) Write the degree and cardinality of the table STORE.
c) Write the following statement :
i) Insert the following data in the table.
ItemNo=2010, ItemName=”Note Book” , Scode=25, quantity = 50
ii) Increase the quantity of all the item by 10.
Or
c)
write the statement to:
i) Delete the record from store table where item No. 2005.
ii) Add column price in the above store table with datatype as float.

35 Vishal has been given following incomplete code which takes a students details 1+1+1+
. (rollnumber, name and marks) and writes into binary file stu.dat using pickling. 1

import ______________________ # statement 1


sturno = int(input(“Enter the rollno”))
stuname= input(“Enter the name”))
stumarks=float(input(“Enter marks”))
stu1={“RollNo”:sturno, “Name”:stuname, “Marks”:stumarks}
with ____________________ as fh: #statement 2
pickle.dump(________) # statement 3
with open(“Stu.dat”,”rb”) as fin:
_____________________ # statement 4

Print(Rstu)
if Rstu[“Marks”] >= 85:
print(“Eligible for merit certificate”)
else:
print(“Not Eligible for merit certificate”)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy