0% found this document useful (0 votes)
112 views

Computer Science (083) - Only 1 Set

This document contains questions from a computer science exam. It has multiple choice and programming questions in sections A through E testing concepts like SQL, Python, networking, databases and more. The questions increase in difficulty from 1 to 5 marks each from section A to E.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views

Computer Science (083) - Only 1 Set

This document contains questions from a computer science exam. It has multiple choice and programming questions in sections A through E testing concepts like SQL, Python, networking, databases and more. The questions increase in difficulty from 1 to 5 marks each from section A to E.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

REGISTRATION NO

ALL KERALA COMMON MODEL EXAMINATION 2023 - 24


COMPUTER SCIENCE(083)
CLASS XII (2023-24)
Time Allowed : 3 hours Max Marks : 70

General Instructions:

Please check this question paper contains 35 questions.


The paper is divided into 4 Sections - A, B, C, D and E.
Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
All programming questions are to be answered using Python Language only.

Section A
(1 mark)
1 State true or false: [1]
The expression 2**2**3 is evaluated as: (2**2)**3.

2 Which of the following is a SQL aggregate function? [1]


a) JOIN
b) LEN
c) AVG
d) LEFT

3 Which method returns the next row from the result set as tuple? [1]
a) fetchone()
b) rowcount
c) fetchall()
d) fetchmany()

4 x=10 [1]
def demo(x):
global x
x+=5
print(x)
demo(x)
What will be the output of the above program?
a) Error
b) 10
c) 15
d) 5
5 What is a Firewall in Computer Network? [1]
a) An operating System of Computer Network.
b) A web browsing Software.
c) The physical boundary of Network.
d) A system designed to prevent unauthorized access.

6 In file handling, what does these terms means "r and a"? [1]
a) read, append
b) read, all
c) None of these
d) read, always

7 l1 = [ 1,2,3,4,5] [1]
l1.append([[ 5,6],[ 7,8],[ 9,10]])
What will be the final length of l1?
a) 10
b) 6
c) 8
d) Error

8 With SQL, how do you select all the records from a table named "Students" [1]
where the value of the column "FirstName" ends with an "a"?
a) SELECT * FROM Students WHERE FirstName LIKE ’%a’
b) SELECT * FROM Students WHERE FirstName = ’%a%’
c) SELECT * FROM Students WHERE FirstName LIKE ’a%’
d) SELECT * FROM Students WHERE FirstName = ’a’

9 State the incorrect way of opening a text file Notes.txt:- [1]


a) file = open("c:\Notes.txt", "r")

b) file = open(r"c:\Notes.txt", "r")

c) file = open("c:\\folder1\\notes.txt")

d) file = open(file = "c:\\Notes.txt", "r")

10 Which line of code will cause an error?. [1]


num = [ 5, 4,3, [ 2, 1]]
print(num[ 0])
print(num[ 3][ 0])
print(num[ 5])
a) Line4
b) Line 3
c) Line1
d) Line2

11 The data structure required to check whether an expression contains balanced [1]
parenthesis is ________.
a) Queue
b) Array
c) Stack
d) Tree

12 Given a function that does not return any value, what value is thrown by default [1]
when executed in shell?
a) void
b) None
c) bool
d) int

13 State true or false: [1]


Every object on the Internet has a unique URL.

14 What is the output of the following code? [1]


t = (10, 20, 30, 40, 50, 50, 70)
print(t[ 5: - 1])
a) (50,70)
b) (50,)
c) (50,50,70)
d) Blank output()

15 Fill in the blanks: [1]


To remove duplicate rows from the result of a query, specify the SQL qualifier
________ in the select clause.

16 Which mobile system is known as Universal Mobile Telecommunications [1]


System?
a) 1G
b) 2G
c) 3G
d) 4G

17 Assertion (A): Python converts the program into byte code, and any platform [1]
can use that byte code.
Reason (R): Python supports object - oriented language.
a) Both A and R are true and R is the correct explanation of A.
b) Both A and R are true but R is not the correct explanation of A.
c) A is true but R is false.
d) A is false but R is true.

18 Assertion (A): CSV stands for comma - separated values , which is defined as [1]
a simple file format that uses specific structuring to arrange tabular data.
Reason (R): The csv module is used to handle the CSV files to read/write and
get data from specified columns.
a) Both A and R are true and R is the correct explanation of A.
b) Both A and R are true but R is not the correct explanation of A.
c) A is true but R is false.
d) A is false but R is true.

Section B
(2 marks)
19 Answer the following questions: [2]
a)What is a Modem? State its functionality.
b)Write one characteristic each for 2G and 3G mobile technologies.
OR
a) Explain any two switching techniques used in networking.
20 Rewrite the program after removing the errors and underline the corrections [2]
made.
Jean wanted to write a program to find the unique names in a list but the
following program does not do so.

def unique(Names_list):
new_list=[]
for names in Names_list
if new_list not in names.title() :
new_list.extend(names.title())
return new_list

Names_list=[ "Manu", "Kiran", "Leena", Nabo", "manu", "kiran", "manu"]


unique(Names_list) = list_names
print(list_names)

21 In the below given code fragments, indicate the data type of each bold part by [2]
choosing the correct type of data from the following type.
i) L = inputline.split( )
while L != ( ) :
print(L)
L = L[ 1 :]

ii) L = [ ’Hiya’, ’Zoya’, ’Preet’]


print(L[ 0]+ L[ 1])
1. int 2. float 3. bool 4. str 5. function 6. list of int 7. list of str
OR
Write a Python code which will pass a string ,entered by the user, as an
argument to a user defined function find_words(). The function should find and
display the number of words that starts with a capital letter.

22 Give the output of the following code: [2]


student={"Namita":[10,12,13], "Nani":[12.5,13,14], "Samit":[13.5,13,14], "Aditya":[13,
15,14]}
List=[]
for data in student:
List.append( (data, max(student[data])))
print(List)

23 What is the output of the following? [2]


True = False
while True:
print(True)
break
OR
Find the output
dict = {}
a, b, c = 15, 25, 35
dict [ a, b, c]= a + b - c
a, b, c = 25, 20, 40
dict [ a, b, c]= a + b - c
print(dict)

24 What are DDL and DML? Give examples. [2]


OR
Differentiate between char(n) and varchar(n) data types with respect to
databases.

25 Write a function in Python that counts the number of "Me" or “My" words [2]
present in a text file "STORY.TXT".
If the “STORY.TXT" contents are as follows:

My first book was Me and My Family.


It gave me chance to be Known to the world.

The output of the function should be:


Count of Me/My in file:
OR
Two identical files (p1.txt and p2.txt) were created by following two codes
(carefully go through the two codes given below).
1.
obj = open("p1.txt","w")
obj.write("Better than Heaven or Arcadia")
obj.write("I love thee, O my India!")
obj.write("And thy love I shall give")
obj.write("To every brother nation that lives.")
obj.close()

2. obj = open("p2.txt", "w")


obj.write("Better than Heaven or Arcadia\n")
obj.write("I love thee, O my India!\n")
obj.write("And thy love I shall give\n")
obj.write("To every brother nation that lives.\n")
obj.close()

What would be the output produced if the files are read and printed with the
following code?
obj1= open(“p1.txt”, “r”)
obj2=open(“p2.txt”, “r”)
print(obj1.read())
print(obj2.read())
obj1.close()
obj2.close()
Section C
(3 marks)
26 Consider the following tables. [3]
TABLE: SENDER

TABLE : RECEPIENT

a) What will be the output for the given query:


SELECT S.SENDERID , R.RECNAME, R,RECCITY FROM SENDER S,
RECEPIENT R WHERE S.SENDERID= R.SENDERID AND R.RECNAME
LIKE “R%”

b) Give the outputs for the following statements:


i) Select distinct reccity from Recepient order by reccity;
ii) Select * from Recepient where Recid like “M%” and SenderID like “M%”;
iii) Select Recid, Recname, Reccity from Recepient where reccity = “Mumbai”
iv) Select count(Recname) from Recepient group by Reccity;

27 Write the output for the queries given below, which are based on the tables. [3]
Table : TRAINER

Table : COURSE
a) Give the output for the following questions:
i) SELECT T.TNAME, C.CNAME FROM TRAINER T, COURSE C WHERE
T.TID = C.TID AND STARTDATE >”2018-08-01”;
ii) SELECT COUNT(*) , CITY FROM TRAINER GROUP BY CITY ORDER BY
CITY;
iii) SELECT SUM(FEES), TID FROM COURSE GROUP BY TID;
iv) SELECT AVG(SALARY) ,CITY FROM TRAINER GROUP BY CITY;

28 Write the Python code to read a text file data.txt which contains lines of text. [3]
Each line of text constitutes of names of persons residing in each colony. The
program should display the lines which has the name “Jacob” in it.
OR
Write the Python code to read a text file List.txt which contains lines of text.
Each line of text constitutes of names of companies in each region.
The names of companies are separated by “;”
For e.g.
ABC PVTLTD; FIONA PUBLISHERS ; DHRAM & SONS PVTLTD ;
JERRY PRINTERS ; HARIOM PVTLTD. ;

The program should find and display the number of PvtLtd companies . The
names of Pvt Ltd companies will end with the word PVTLtd.

29 Consider the following table named "SOFTDRINK". [3]


Table : SOFTDRINK

i) State the cardinality and degree of relation of the above table if two more
rows were added and 3 columns were added.
ii) State the candidate and primary keys of the above table.
iii) Write the statement to increase the price by 10% of Green Mango and Aam
Panna.

30 Write a program to implement a stack for these book details (book no., book [3]
name). That is, now each item node of the stack contains two types of
information - a book no. and its name of those books that has book nos
greater than 2000. Implement Push( List of Books) and pop() with display
operations.

Section D
(4 marks)
31 Consider the following data is store in a CSV file:- [4]
Write the program code to read the above CSV file Item.csv and display the
details of the Item that has the maximum rate.

32 Consider the following data that is stored in a binary file “Student.dat” which [4]
contains data in the following format.
{ (102, “Neena”) : “Computer Science”, (320, “Leena”): “Physics”, (430,
“Teena”):”Chemistry”………}
Write the Python code to read the above file and display the students having
the subject SUB passed as parameters to a function display() .

Section E
(5 marks)

33 Great Studies University is setting up its Academic schools at Sunder Nagar [5]
and planning to set up a network. The university has 3 academic schools and
one administration centre as shown in the diagram below:

Center to center distances between various buildings is as follows:

Number of Computers in each of the Schools/Center is as follows:

1. Suggest the most suitable place (i.e., Schools/Center) to install the


server of this university with a suitable reason.
2. Suggest the most efficient connecting medium for connecting these
Schools/center for wired connectivity.
3. Which device you will suggest to be placed/installed in each of these
Schools! center to efficiently connect all the computers within these
Schools/center?
4. The university is planning to connect its admission office in the closest
big city, which is more than 350 km from the university. Which type of
network out of LAN, MAN or WAN will be formed? Justify your answer.
5. Draw the cable layout to connect the above schools. Also state the
medium of communication to connect the machines within each school.
Give the reason.

34 i) State the difference between seek() and tell() giving an example of each. [5]
ii) Dr. Ramesh stores the details of his patients in a binary file “Patient.dat” as
following:-
{“Name “: ………., “Patient_Id”:………, “ Prescribed Medicine”: [Medicine1,
Medicine 2….] }
{“Name “: ………., “Patient_Id”:………, “ Prescribed Medicine”: [Medicine1,
Medicine 2….] }
etc.
Dr. Ramesh would like to know the names of patients that he has prescribed
the medicine “Amoxyciline”.
Write a program code in Python to read the above file and display the names of
patients to whom “Amoxyciline” was prescribed.
OR
i) Suppose a text file “Report.txt” has the following content:
It is festival time
People are enjoying the festivities

Give the output of the following code:

with open("report.txt", "r+") as f:


f.seek(6)
f.write("joyous")
f.seek(0)
print(f.readline())

ii) Dr. Ramesh stores the details of his patients in a binary file as following:-
{“Name “: ………., “Patient_Id”:………, “ Prescribed Medicine”: [Medicine1,
Medicine 2….] }
{“Name “: ………., “Patient_Id”:………, “ Prescribed Medicine”: [Medicine1,
Medicine 2….] }
etc.
Write a program code in Python to read the above file and display the names of
patients who have been prescribed more than 3 medicines.
35 i) State the difference between ALTER and UPDATE command with an [5]
example
ii)The school has stored the details of the faculty in the database “SCHOOL” in
a table called Faculty.
The data in the faculty is as given as below:-

Names Qualification Subject Years_exp


Mr. Rajiv MA, BEd History 10
Mr. Shaw MA, BEd English 15
Ms. Ronaldo MSc. BEd Chemistry 12
Ms. Preethy MSc. Bed Physics 20

Note the following to establish connectivity between Python and MySQL:

Username - root
Password - tiger
Host - localhost

Write a user defined function Connect() in Python to read the content of the
above file and display the names and qualification of those faculty members
who are teaching the subject SUB which is passed as parameter to the function
Connect().

OR
a) What is the difference between equi join and natural join.

b) The code given below updates the following record in the table :
i) The table exists in a MYSQL database named Inventory
ii) The table is ITEMS
iii) The fields in ITEMS are: Itcode, Itname, Quantity, Price

Note the following to establish connectivity between Python andMYSQL:


Username - root
Password - tiger
Host - localhost
Write the missing statements in Python MySql connectivity to add a column
Supp_Name of type varchar and size 25 to the table ITEMS.

import mysql.connector as sqlcon


def sql_connect():
mycon = sqlcon.connect(host=’localhost’, database =’inventory’,
user=’root’, passwd= ‘root123’)
cursor1= mycon.cursor()
query = ______________________ # statement 1
cursor1.execute(__________) #statement2
cursor1.execute(“____________________________”) #statement3
data= _____________________ # statement4
for i in data:
print(i)

i) Statement 1: to add the column to the table.


ii) Statement 2: to execute the query
iii) Statement 3: To display the records of all items.
iv) Statement 4: To retrieve all records from the resultset.

You might also like