MS-Computer Science-12-Practice Paper - 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

CHENNAI SAHODAYA SCHOOLS COMPLEX

COMMON EXAMINATION 2024


Class-12
(COMPUTER SCIENCE 083)
Marking Scheme
SECTION A
1 Value error 1
2 c) ans 1
3 (d)Statement 1 and 3 1
4 [True, 1, 0, False] 1
5 c) uteruter 1
6 closed() 1
7 Alter 1
8 Cartesian product 1
9 Foreign Key 1
10 can only concatenate list 1
11 c) both iii and iv 1
12 c) cursor 1
13 Switch 1
14 ['1','2','3'] 1
7
15 DML 1
16 b)Username, Password, Hostname 1

17 d) A is false but R is True 1


18 b) Both A and R are true and R is not the correct explanation for A 1

SECTION B
def fact(num):#error1 not D instead lowercase d 2
19 factorial = 1
if num < 0:
print("Sorry, factorial does not exist for negative numbers")
elif num == 0 ) #error2 not else it is elif
print("The factorial of 0 is 1")
else:
for i in range(1,num + 1):
factorial = factorial*i#error3 indentation error
print("The factorial of",num,"is",factorial)#error4 indentation error
Award ½ march each error

1
CHENNAI SAHODAYA SCHOOLS COMPLEX

20 Router 2
 Connects to a modem via a WAN port.
 Also creates a local network between connected devices.
 Connects to the internet.
 Splits one internet connection to many devices.
 Connects local devices to each other and the internet.
Switch
 Connects to a router.
 Used within a LAN to connect devices to each other and to the router.
 Unsafe to connect directly to the internet.
 Several switches can be connected to one router.
 Only connects local devices to each ot her.
(or)
Connection In a bus topology, all the In star topology, all the nodes are
of nodes nodes are connected to a connected to a central controller
single communication line called a hub with a dedicated
with the help of drop lines and point-to-point link.
taps.

Expansion In a bus topology, expansion is In star topology, expansion is very


of nodes easier. A new node can be easy. A new node can be easily
easily added using a connected using a central hub.
connector.

Chances of In a bus topology, the chances In star topology, the chances of


data of data collisions are very high. data collisions are very low.
Collison

Failure of a In a bus topology, the failure In star topology, the failure of a


node of a node does not affect the node affects the whole network.
whole network.
Award ½ mark for each difference at least 2 differences
21 (ii) 21 120 76 1500 2
Award ½ mark for each
22 The PRIMARY KEY constraint uniquely identifies each record in a table. Primary keys must contain UNIQUE 2
values, and cannot contain NULL values.
In a student table rollno is primary key
Award one mark each correct definition and 1 mark for example
23 (a) Write the full forms of the following: 2
(i) POP3 –Post Office Protocol (ii) TCP/IP Transmission Control Protocol/Internet Protocol
iii) IMAP Internet Message Access Protocol iv) EDGE Enhanced Data global Evolution
Award ½ mark for each abbreviation
(b) VoIP Voice over Internet protocol Voice Over Internet Protocol, is a technology that allows you to make
2
CHENNAI SAHODAYA SCHOOLS COMPLEX

calls over the internet instead of traditional phone lines or cellular connection
Award 1 mark for correct ans
24 [5, 11, 12] [5, 11, 12] yes same shallow copy 2
1 mark for output and 1 mark for the description
OR
i) (9, 10, 5, 6, 7)
ii) Predict the output? 4
Award 1 mark for each output
25 CHAR Data Type VARCHAR Data Type 2

Its full name is CHARACTER Its full name is VARIABLE CHARACTER

It stores values in fixed lengths and VARCHAR stores values in variable length
are padded with space characters to
along with 1-byte or 2-byte length prefix
match the specified length
and are not padded with any characters

It can hold a maximum It can hold a maximum of 65,535


of 255 characters. characters.

It uses static memory allocation. It uses dynamic memory allocation.

mysql>create table emp(name mysql>create table emp1(name


CHAR(20));
VARCHAR(20));

OR
SQL aggregate functions includes AVG(), COUNT(), MIN(), MAX(), and SUM().

 COUNT (): This function returns the number of records (rows) in a table.
The Syntax of the Select count (Desig) from employee.
 SUM (): This function returns the sum of all values of a column in a table.
Here is the syntax select sum( salary) from employee
 AVG () This function will return the average of all values present in a column.
The syntax of the select AVG (salary) from employee.
 MIN (): This function produces the lowest value in a column for a group of rows that satisfy
a given condition
Award ½ mark for each difference and at least two differences award full mark
SECTION C
3
CHENNAI SAHODAYA SCHOOLS COMPLEX

26 (a) Natural Join 1+2


Award one mark for the correct answer
(b)
i) PName ,Average (UPrice);
Washing Powder 120
Toothpaste 49.5
Soap 32.5
Shampoo 245
ii) DISTINCT Manufacturer
Surf
Colgate
Lux
Pepsodent
Dove
iii) COUNT (DISTINCT PName)
4
iv) PName, MAX(UPrice), MIN(UPrice)

Washing Powder 120 -


Toothpaste 65 54
Soap 38 25
Shampoo 245 -
Award ½ mark for each output

27 def count_words(): 3

file = open("myfile.txt","r")
count = 0
for i in file.read():
if i.isdigit():
count += 1
print("Total words are",count)
count_words()

Award ½ mark for opening a file


Award ½ mark for reading from a file
Award 1 mark for correct logic
Award ½ for counting and ½ mark printing
OR

def count_words():
4
CHENNAI SAHODAYA SCHOOLS COMPLEX

file = open("myfile.txt","r")
count = 0
count1=0
i=file.read()
j=i.split()
for k in j:
if k== "my":
count += 1
elif k== "me":
count1 += 1
print("Total words my and me are",count,count1)

Award ½ mark for opening a file


Award ½ mark for reading from a file
Award 1 mark for correct logic
Award ½ for counting and ½ mark printing

28 l=eval(input(“enter”))
for ptr in range(2):
while True:
l[ptr],l[ptr+2]=l[ptr+2],l[ptr]
ptr+=4
if ptr>len(l)-3:
break
print(l)

Award ½ mark for input a list


Award ½ mark for correct loop
Award 1 mark for correct logic
Award ½ for breaking the loop and ½ mark printing

29 i) Update personal set salary=0.5*salary where is not NULL 3


ii) Select Name, Salary + Allowance as ‘Total Salary ‘ from personal;
iii) Delete from personals where salary >25000
iv)
Award 1 mark for correct query

5
CHENNAI SAHODAYA SCHOOLS COMPLEX

30 Status=[1,"0M",' 25/6/1970' ,12],["Kumar",' 30/8/1970' ,11],['Lavanya',' 25/6/1998' ,12] 3


def PUSH(S,N):
S.append(N)
def POP(S):
if S!=[]:
return S.pop()
else:
return None
ST=[]
for k in Status
PUSH(ST,k)
while True:
if ST!=[]:
print(POP(ST),end=" ")
else:
print('stack empty
break
OR
Dbook={"Python":350,"Hindi":200,"English":270,"Physics":600, 'chemistry':550}
def PUSH(S,N):
S.append(N)
def POP(S):
if S!=[]:
return S.pop()
else:
return None
ST=[]
for k in Dbook:
if Dbook[k]>=300:
PUSH(ST,k)
while True:
if ST!=[]:
print(POP(ST),end=" ")
else:
break
Award ½ mark for input a list or dict
Award 1 mark for push function
Award 1 mark for pop function
Award ½ for calling and printing
SECTION D
31 a) .Predict the output from the following table: 1+1
1. Award one mark for correct answer +2
ITEM_ID ITEM_NAME COMPANY_ID COMPANY_NAME
---------- ---------- ------------------------- ---------- ---------------------
1 Chex Mix 16 Akas Foods

6
CHENNAI SAHODAYA SCHOOLS COMPLEX

6 Cheez-It 15 Jack Hill


2 BN Biscuit 15 Jack Hill
4 Pot Rice 15 Jack Hill
2. Award one mark for correct answer
COMPANY_ID ITEM_ID ITEM_NAME COMPANY_NAME
---------- ---------- ------------------------- ---------- ---------------------
16 1 Chex Mix Akas Foods
15 6 Cheez-It Jack Hill
15 2 BN Biscuit Jack Hill
15 4 Pot Rice Jack Hill
b) Given below are the tables for a database Events:

A) Degree 6 and Cardinality 5 Student X Event_Assigned Cartesian Product


Award one mark for correct answer
B) Primary Key Event_Id
Candiadate Key Event_Id,Rollno
Event_Id is the foreign key for the current table as Event_id is primary key of the student
table
Award one mark for correct answer
32

7
CHENNAI SAHODAYA SCHOOLS COMPLEX

Award ½ mark for opening a file


Award ½ mark for creating a writer object and input
Award ½ mark for writing into the file
Award ½ mark for opening a file
Award ½ mark for creating a reading object and check appropriate condition
Award ½ mark for printing from the file

SECTION E
33 Award one mark for each correct answer 5

a. Coaxial cable, star topology


b. Academic Block as per 80:20 network the server should be placed where there is
maximum number of computers
c. Switch as it is the device used to connect all computers in the block
d. No need of repeater as distance between server and other building is less than 100 mts
e. Optical Fiber
f.
Award 1 mark for correct answer

34 a) 3+2
0,@6,@7,@8,@9,@25,@11,@
0,@6,@7,@8,@9,@
0,@6,@7,@

Award one mark for each line correct answer

b) mycursor=mydb.cursor() statement1
rq=’’’insert into Employee (Empno, Ename, Design,Salary)

values (1,’aaa’,’clerk’,25000’)’’ #statement2

mycursorexecute(rq)#statement 3

mydb.commit()#statement4

Award ½ mark each correct answer

8
CHENNAI SAHODAYA SCHOOLS COMPLEX

35 a. i)tell() function will tell where the file pointer. Update operation 5
Award one mark for correct answer
b. 1. f.seek(offset,mode)
Award one mark for correct answer
import pickle
def create():
f=open('s.dat','wb' )
ans='y'
while ans.lower()=='y':
admno=int(input("Enter Student ID: "))
name=input( "Enter Student Name: ")
clas=input("Enter class: ")
ans=input("Do you want to add more recods ?")
sturec=[admno,name,clas]
pickle.dump(sturec,f)
f.close()
def count():
file =open( "s.dat",'rb')
m=0
while True:
try:
data=pickle.load(file)
if data[1][0]=='A':
print(data)
if data[2]=='xii':
m=m+1
except:
file.close()
return m

create()
print(count())
Award ½ mark for opening a file
Award ½ mark for input the dta
Award ½ mark for writing into the file
Award ½ mark for opening a file
Award ½ mark for a reading and check appropriate condition
Award ½ mark for printing from the file

a. pickle.dump(python object,file object) this dump function will write into binary a file
pickle. Load(ile objectf) function read from the binary file.
Award one mark for the purpose dump and load function
Award one mark for writing the syntax
b. import pickle
def create():
f=open('animal.dat','wb')
ans='y'
while ans.lower()=='y':
animalname=input("Enter animalname ID: ")
animaltype=input( "Enter animaltype: ")
animalfood=input("Enter animalfood: ")
ans=input("Do you want to add more recods ?")
anirec=[animalname,animaltype,animalfood]
pickle.dump(anirec,f)
f.close()

9
CHENNAI SAHODAYA SCHOOLS COMPLEX

def copy():
data=[]
file =open ( 'animal.dat','rb' )
f=open('animal1.dat','wb')
while True:
try:
data=pickle.load(file)
print(data)
if data[2]=='grass':
pickle.dump(data,f)
print(data)
except:
file.close()
f.close()
create()
copy()
Award ½ mark for opening a file
Award ½ mark for input
Award ½ mark for writing into the file
Award ½ mark for opening a file
Award ½ mark for reading and check appropriate condition
Award ½ mark for printing from the file

10

You might also like