0% found this document useful (0 votes)
18 views11 pages

12 CS PB1 Hyd QP MS B

The document outlines the marking scheme for the Class 12 Computer Science pre-board examination for the academic year 2024-25, detailing the structure of the exam divided into five sections with varying question types and marks. It includes specific questions and answers related to programming concepts, SQL, and computer science principles. The document serves as a guide for students to prepare for their upcoming examination.

Uploaded by

laksharuvaa
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)
18 views11 pages

12 CS PB1 Hyd QP MS B

The document outlines the marking scheme for the Class 12 Computer Science pre-board examination for the academic year 2024-25, detailing the structure of the exam divided into five sections with varying question types and marks. It includes specific questions and answers related to programming concepts, SQL, and computer science principles. The document serves as a guide for students to prepare for their upcoming examination.

Uploaded by

laksharuvaa
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/ 11

FIRST PRE-BOARD EXAMINATION

(2024-25)
CLASS-12
SUBJECT-COMPUTER SCIENCE (083)
MARKING SCHEME
Time Allowed: 3 hours Maximum Marks: 70
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A has 21 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 04 Short Answer type questions carrying 03 marks each.
6. Section D has 02 Long Answer type questions carrying 05 marks each.
7. Section E has 03 questions carrying 04 marks each.
8. All programming questions are to be answered using Python Language only.
SECTION-A
S.No Question Marks
1 What is the return type of function id? 1
a) int b) float c) bool d) dict
Ans: a) int
2 What error occurs when you execute? 1
apple = mango
a) SyntaxError
b) NameError
c) ValueError
d) TypeError
Ans: b) NameError
3 Carefully observe the code and give the answer. 1
def example(a):
a = a + '2'
a = a*2
return a
>>>example("hello")
a) indentation Error
b) cannot perform mathematical operation on strings
c) hello2
d) hello2hello2
Ans: a) indentation Error
4 Aryan created a table (Students) with 5 rows and 6 columns. After few days based on the 1
requirement he added 3 more rows to the table. What is the cardinality and degree of the table?
a) cardinality=6,degree=8
b) cardinality=8,degree=6
c) cardinality=5 degree=8
d) None of the above
Ans: b) cardinality=8,degree=6
5 What is the output of the following? 1
print("xyyzxyzxzxyy".count('xyy', 0, 100))
a) 2
b) 0
c) 1
d) error
Ans: a) 2
6 What is the output of the below program? 1
def func(a, b=5, c=10):
print('a is', a, 'and b is', b, 'and c is', c)

func(3, 7)
func(25, c = 24)
func(c = 50, a = 100)

a)a is 7 and b is 3 and c is 10


a is 25 and b is 5 and c is 24
a is 5 and b is 100 and c is 50
b)a is 3 and b is 7 and c is 10
a is 5 and b is 25 and c is 24
a is 50 and b is 100 and c is 5
c) a is 3 and b is 7 and c is 10
a is 25 and b is 5 and c is 24
a is 100 and b is 5 and c is 50
d) None of the mentioned
Ans: c) a is 3 and b is 7 and c is 10
a is 25 and b is 5 and c is 24
a is 100 and b is 5 and c is 50
7 Which of the following statements are true? 1
a) When you open a file for reading, if the file does not exist, an error occurs
b) When you open a file for writing, if the file does not exist, a new file is created
c) When you open a file for writing, if the file exists, the existing file is
overwritten with the new file
d) All of the mentioned
Ans: d) All of the mentioned
8 Which of the following is equivalent to random.randint(3, 6)? 1
a) random.choice([3, 6])
b) random.randrange(3, 6)
c) 3 + random.randrange(3)
d) 3 + random.randrange(4)
Ans: d) 3 + random.randrange(4)
9 Entries in a stack are “ordered”. What is the meaning of this statement? 1
a) A collection of stacks is sortable
b) Stack entries may be compared with the ‘<’ operation
c) The entries are stored in a linked list
d) There is a Sequential entry that is one by one
Ans: d) There is a Sequential entry that is one by one
10 Bridge works in which layer of the OSI model? 1
A. Application layer
B. Transport layer
C. Network layer
D. Data link layer
Ans: D. Data link layer
11 SMTP stands for 1
(a) sample mail transfer protocol
(b) simple message transportation protocol
(c) simple mail transfer protocol
(d) synchronous message transmit protocol
Ans: (c) simple mail transfer protocol
12 Which of the following statement will reverse the list L1? 1
a)L1[::1]
b)L1[-1::-1]
c)L1[::-1]
d)None of the above
Ans: c)L1[::-1]
13 Out of one or more candidate keys, the attribute chosen by the database designer to uniquely 1
identify the tuples in a relation called______ of that relation.
a)primary key
b)foreign key
c)composite primary key
d)alternate key
Ans: a)primary key
14 The loop else statement is executed when 1
a)the for loop is executed for the last value in the sequence
b)the while loop test condition evaluates to false
c)both a and b
d)none of the above
Ans: c)both a and b
15 Hub decreases the traffic in the network whereas switch increases the traffic in the network. 1
(Ture/False)
Ans: False
16 Which of the following expressions evaluates to False? 1
a) not(True) and False
b) True or False
c) not(False and True)
d) True and not(False)
Ans: a) not(True) and False
17 Which of the following is an invalid identifier? 1
(a)_123 (b) E_e12 (c) None (d) true
Ans: (c) None
18 Which of the following is a DML command? 1
(a) DROP (b) INSERT (c) ALTER (d) CREATE
Ans: (b) INSERT
19 Which aggregate function can be used to find the cardinality of a table?
a) sum()
b) count()
c) avg()
d) max()

Ans: b) count()
20 Assertion(A):Python uses immutable types for call by value mechanism
Reason (R): in the call by value mechanism, the called function makes a separate copy of passed
values and then works with them.
a) Both A and R are wrong
b)A is wrong, but R is right
c)A is right, but R is wrong
d)Both A and B are Right
Ans: d)Both A and B are Right
21 Assertion (A): Python automatically flushes the file buffers before closing a file with close ()
function.
Reason (R): when you open an existing file for writing, it adds the content at the end of the file.
a) Both A and R are wrong
b)A is wrong, but R is right
c)A is right, but R is wrong
d)Both A and B are Right
Ans: c)A is right, but R is wrong
SECTION-B
22 Write the output given by following Python code. 2
x=1
def fun1():
x=3
x=x+1
print(x)

def fun2():
global x
x=x+2
print(x)

fun1()
fun2()
OR
What do you mean by default parameters? Explain with the help of suitable example.
Ans: 4
3
OR
Definition-1
Suitable example-1
23 (i) Write the SQL statement to add a field Country_Code(of type Integer) to the table Countries 1+1
withthe following fields.
Country_id, Country_name, Continent, Region_id
(ii) Which of the following is not a DML command?
DELETE FROM, DROP TABLE, CREATE TABLE, INSERT INTO
Ans: (i) for writing of alter table query-1
(ii) DROP TABLE-1
24 What are the possible outcome(s) executed from the following code? Also specify the maximum 2
and minimum values that can be assigned to variable N.
import random
SIDES=["EAST","WEST","NORTH","SOUTH"]
N=random.randint(1,3)
OUT=""
for I in range (N,1, –1):
OUT=OUT+SIDES[I]
print (OUT)

(i) SOUTHNORTH
(ii) SOUTHNORTHWEST
(iii) SOUTH
(iv) EASTWESTNORTH
Ans: (ii) SOUTHNORTHWEST -1 mark
Maximum value of variable N is 3- ½ mark
Minimum value of variable N is 1- ½ mark
25 Write two points of difference between Bus Topology and Tree Topology. 2
OR
Write two points of difference between Packet Switching and Circuit Switching techniques?
Ans:
BUS TOPOLOGY STAR TOPOLOGY
Bus topology is a topology where each device is connected Star topology is a topology in which all
to a single cable which is known as the backbone. devices are connected to a central hub

In a Bus topology, the failure of the network cable will In star topology, if the central hub fails then
cause the whole network to fail. the whole network fails.

In a bus topology, there is a linear arrangement of nodes in In star topology, there is a non-linear
a network. arrangement of nodes in a network.

OR
DOMAIN OF
CIRCUIT SWITCHING PACKET SWITCHING
COMPARISON

Transmission of data is done Data is transmitted in the form of segments


Definition through a physically mapped circuit called data packets through dynamic channels of
between the source and the target. data transmission.

The data is processed at the source before


Transmitted data is demodulated
transmission as well as at the nodes and receiver
Data processing and processed at the receiver end
end during transmission and post completion
through hardware.
respectively.

As there is no fixed route of data transmission


The route of data transmission is hence there is flexibility in transmitting packets
Flexibility
predefined and is rigid. through different channels as per traffic or other
constraints.

Finds maximum usage in voice-over It has wide utility in the field of data
Utility
or telephonic communication. transmission over networks.

26 2

Write the output of the queries (a) to (d) based on the table SCHOOLADMINgiven below:
a) SELECT max (DOB) FROM SCHOOLADMIN;
b) SELECT Name FROM SCHOOLADMIN WHERE STREAM<>"Business Admin" AND
SECTION IS NULL;
c) SELECT count (NAME) FROM SCHOOLADMIN WHERE SECTION IS NOT NULL;
d) SELECT count (NAME) FROM SCHOOLADMIN WHERE SECTION IS NOT NULL AND
STREAM="FINE ARTS";
Ans: a)Max(DOB)
2005-05-12
b)empty set
c)count(name)
5
d)count(name)
2
27 Rewrite the following Python program after removing all the syntactical errors (if any), 2
underlining each correction:

def checkval:
x = input(“Enter a number”)
if x % 2 = 0:
print x,”is even”
else if x<0:
print x,”should be positive”
else;
print x,”is odd”
Ans: def checkval:
x = int(input(“Enter a number”))
if x % 2 == 0:
print (x,”is even” )
elif x<0:
print( x,”should be positive”)
else:
print( x,”is odd”)
28 (a) What is the output produced by the following code – 1
d1={“b”:[6,7,8],”a”:(1,2,3)}
print(d1.values())
a) { (1,2,3) , [6,7,8] }
b) [[6,7,8],(1,2,3)]
c)[6,7,8,1,2,3]
d) (“b”, “a”)
(b) What is the output of given program code: list1 = range(100,110) 1
print( list1.index(105))
(a) 4 (b) 5 (c) 6 (d) Error
Ans: (b)[[6,7,8],(1,2,3)]
(b) 5
SECTION-C
29 (a)Write a function in python to count the number of lines in “POEM.txt” begins from Upper case 3
character.
OR
Write a function in python to read lines from file “POEM.txt” and count how many times the word
“INDIA” exists in file.
Ans: for function header- ½ mark
for body of the function(including opening of the file,logic) -1 ½ mark
closing of the file- ½ mark
30 Write a function in Python PUSH(Num), where Num is a list of integer numbers. From this list 3
push all positive even numbers into a stack implemented by using a list. Display the stack if it has
at least one element, otherwise display appropriate error message.
OR
Write a function in Python POP(cities), where cities is a stack implemented by a list of city names
for eg. cities=[‘Delhi’, ’Jaipur’, ‘Mumbai’, ‘Nagpur’]. The function returns the value deleted from
the stack.
Ans: For writing of the push function with all syntax and correct logic-3 marks
31 (a)Sonal needs to display name of teachers, who have “0” as the third character in their name. She 1
wrote the following query.
SELECT NAME FROM TEACHER WHERE NAME = “$$0?”;
But the query is’nt producing the result. Identify the problem.
(b)Write output for (i) & (iv) based on table COMPANY and CUSTOMER.

i.SELECT COUNT(*) , CITY FROM COMPANY GROUP BY CITY;


ii.SELECT MIN(PRICE), MAX(PRICE) FROM CUSTOMER WHERE QTY>10;
iii.SELECT AVG(QTY) FROM CUSTOMER WHERE NAME LIKE “%r%;
iv.SELECT PRODUCTNAME, CITY, PRICE FROM COMPANY, CUSTOMER
v.WHERE COMPANY.CID=CUSTOMER.CID AND PRODUCTNAME=”MOBILE”;
(b) Observe the following code and answer the questions that follow: 2
File = open("Mydata","a")
_____________________ #Blank1
File.close()
(i)What type (Text/Binary) of file is Mydata?
(ii)Fill in Blank 1 with a statement to write “ABC” in the file “Mydata”.
Ans: (a) SELECT NAME FROM TEACHER WHERE NAME LIKE “_ _0%”;
_ and % are the wildcards for pattern matching.
(b) i.

ii. 50000,70000
iii.11
iv.

32 Write a function EVEN_LIST(L), where L is the list of elements passed as argument to the 3
function. The function returns another list named ‘evenList’ that stores the indices of all even
numbers of L.
For example:
If L contains [12,4,3,11,13,56]
The evenList will have - [0,1,5]
Ans: def EVEN_LIST(L):
evenList=[]
for i in L:
if i%2==0:
evenList.append(i)
return(evenList)
SECTION-D
33 Write a python program to create a csv file dvd.csv and write 10 records in it with the following 5
details: Dvdid, dvd name, qty, price.
Display those dvd details whose dvd price is more than 25.
Ans: import csv
f=open("pl.csv","w")
cw=csv.writer(f)
ch="Y"
while ch=="Y":
l=[]
pi=int(input("enter dvd id "))
pnm=input("enter dvd name ")
sp=int(input("enter qty "))
p=int(input("enter price(in rupees) "))
l.append(pi)
l.append(pnm)
l.append(sp)
l.append(p)
cw.writerow(l)
ch=input("do you want to enter more rec(Y/N): ").upper()
if ch=="Y":
continue
else:
break
f.close()
f=open("pl.csv","r+")
cw=list(csv.reader(f))
for i in cw:
if l[3]>25:
print(i)
f.close()
34 Consider the tables below to write SQL Queries for the following:

i.To display TEACHERNAME, PERIODS of all teachers whose periods are more than 25.
ii.To display all the information from the table SCHOOL in descending order of experience.
iii. To display DESIGNATION without duplicate entries from the table ADMIN.
iv. To display TEACHERNAME, CODE and corresponding DESIGNATION from tables
SCHOOL and ADMIN of Male teachers.
Ans:

SECTION-E
35 Perfect Edu Services Ltd. is an educational organization. It is planning to setup its India campus at Chennai
with its head office at Delhi. The Chennai campus has 4 main buildings – ADMIN, ENGINEERING,
BUSINESS and MEDIA.
You as a network expert have to suggest the best network related solutions for their problems raised in (i) to
(v), keeping in mind the distances between the buildings and other given parameters.

(i) Suggest the most appropriate location of the server inside the CHENNAI campus (out of the 4
buildings), to get the best connectivity for maximum no. of computers. Justify your answer.
(ii) Suggest and draw the cable layout to efficiently connect various buildings within the
CHENNAI campus for connecting the computers.
(iii) Which hardware device will you suggest to be procured by the company to be installed to
protect and control the internet uses within the campus ?
(iv) Which of the following will you suggest to establish the online face-to-face communication
between the people in the Admin Office of CHENNAI campus and DELHI Head Office ?
(a) Cable TV
(b) Email
(c) Video Conferencing
(d) Text Chat
(v) Name protocols used to send and receive emails between CHENNAI and DELHI office?
(i)admin; it contains the max number of systems. to reduce traffic
(ii)

(iii)firewall
(iv) (c) Video Conferencing
(v) POP and SMTP
36 A binary file “STOCK.DAT” has structure [ITEMID, ITEMNAME, QUANTITY, PRICE]. 5
(i) Write a user defined function MakeFile( )to input data for a record and add to Book.dat.
(ii) Write a function GetPrice(ITEMID) in Python which accepts the ITEMID as parameter and
return PRICE of the Item stored in Binary file STOCK.DAT.
OR
A binary file “EMPLOYEE.DAT” has structure (EMPID, EMPNAME, SALARY). Write a
function CountRec( )in Python that would read contents of the file “EMPLOYEE.DAT” and
display the details of those Employees whose Salary is above 20000. Also display number of
employees having Salary more than 20000.
Ans: For function MakeFile()-2 marks
For function GetPrice()-3 marks
37 (a)Write the outputs of the SQL queries (i) to (ii) based on relations EMP and DESIG given
below:
Table: EMP
E_ID Name Gender Age DOJ Designation
1 Om Prakash M 35 10/11/2009 Manager
2 Jai Kishan M 32 12/05/2013 Accountant
3 Shreya Sharma F 30 05/02/2015 Clerk
4 Rakesh Minhas M 40 15/05/2007 Manager
5 Himani Singh F 33 19/09/2010 Clerk

Table: DESIG
Salary E_ID DEPT_ID
45000 1 D101
35000 2 D102
45000 4 D101
(i) SELECT Designation, count(*) FROM EMP GROUP BY Designation;
(ii) SELECTEMP.Name,EMP.Designation,DESIG.Salary FROM EMP,DESIG WHERE
EMP.E_ID = DESIG.E_ID AND EMP.Age>35;

(b)
Note the following to establish connectivity between Python and MYSQL:
• Username is root
• Password is root@123
• The table exists in a MYSQL database named management.
Write the following missing statements to complete the code:
Statement 1 – to form the cursor object
Statement 2 – to execute the query that extracts records of those employees whose salary are greater
than 53500.
Statement 3- to read the complete result of the query (records whose salary are greater than 53500)
into the object named data, from the table employee in the database.
import mysql.connector as mysql
def sql_data():
con1=mysql.connect(host="localhost",user="root",password="root@123",
database="management")
mycursor=_______________ #Statement 1
print("Employees with salary greater than 53500 are : ")
_________________________ #Statement2
data=__________________ #Statement 3
for i in data:
print(i)
print()
Ans:
(a) For each output of the query 1 mark

(b)
Statement 1: con1.cursor()
Statement 2: mycursor.execute("select * from student where Marks>75")
Statement 3: mycursor.fetchall()

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