0% found this document useful (0 votes)
25 views7 pages

Grade-12 Re-5 QP

This document is a revision exam paper for Grade XII Computer Science, consisting of multiple-choice questions, coding tasks, and SQL queries. It covers various topics such as programming concepts, data types, database operations, and network protocols. The exam is structured into sections with a total of 70 marks, including theoretical and practical components.

Uploaded by

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

Grade-12 Re-5 QP

This document is a revision exam paper for Grade XII Computer Science, consisting of multiple-choice questions, coding tasks, and SQL queries. It covers various topics such as programming concepts, data types, database operations, and network protocols. The exam is structured into sections with a total of 70 marks, including theoretical and practical components.

Uploaded by

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

SRI AMBAL THULASI PUBLIC SCHOOL, ANNUR

GRADE : XII REVISION EXAM-5 MAX. MARKS : 70


SUBJECT : COMPUTER SCIENCE(083) DATE: 12.12.2024 TIME : 3 HOURS
Q.NO SECTION – A MARKS
(18*1=18)
1) State True or False: 1
“The continue statement skips the rest of the loop and jumps over to the statement
following the loop “
2) What should be the data type for the column Amount storing values less than 1
Rs.1000, e.g., 800.88?
a) VARCHAR(50) b) NUMBER(3,2) c) NUMBER(5,2) d) NUMBER(6)
3) What will be the output of the following statement: 1
print(6//5+2**3**2-50%31)
a) 494.0 b) 494 c) 46 d) Error
4) Select the output of : 1
S='India is beautiful'
L=S.split()
S1='_'.join([L[0].upper())
L[0+1].replace('is','is'),L[2].capitalize()])
print(S1)
a) India_is_Beautiful b) INDIA_IS_IS_Beautiful
c) INDIA_is_Beautiful d) INDIA_is_is_Beautiful
5) Relation emp has 10 tuples and 5 attributes. Relation dept has 0 tuples and 7 1
attributes. When a CROSS JOIN is achieved between emp and dept, how
many tuples would the resultant set have?
a) 28 b) 10 c) 0 d) 35
6) A network which is formed by interconnection of two mobile phone through 1
Bluetooth is called ____________
a) MAN b) PAN c) LAN d) WAN
7) Given the following dictionaries 1
dict_student = {"rno" : "88", "name" : ‘Rohit’}
dict_marks = {"CSC" : 95, "Maths" : 90}
Which statement will merge the contents of both dictionaries?
a) dict_student + dict_marks b) dict_student.add(dict_marks)
c) dict_student.merge(dict_marks) d) dict_student.update(dict_marks)
8) Consider the statements and choose the correct output for the given options: 1
s='never give up'
print(s[-2 : 3 :-2])
a) uei b) u ev c) uvi d)uu
9) Which of the following statement(s) would give an error after executing the 1
following code?
S="Welcome to class XII" # Statement 1
print(S) # Statement 2
S="Thank you" # Statement 3
S[0]= '@' # Statement 4
S=S+"Thank you" # Statement 5
a) Statement 3 b) Statement 4 c) Statement 5 d) Statement 4 and 5
10) What are the possible outcomes expected? 1
import random
pick=random.randint(0, 3)
city=['Kerala','Karanataka','Chennai','Goa']
for i in city:
for j in range(1,pick):
print(i,end='')
print()
a) Kerala b) Kerala
Karnataka KeralaKarnataka
Chennai KeralaKarnatakaGoa
Goa ChennaiGoa

b) KeralaKerala d) Kerala
KarnatakaKarnataka KarnatakaKerala
ChennaiChennai GoaChennai
GoaGoa ChennaiGoa
11) _______ protocol provide access to command line interface on a remote computer. 1
a) FTP b) ppp c) Telnet d) SMTP
12) Consider the code given below: 1
b=100
def check(a):
________
b=b+a
print(a,b)
check(10)
print(b)
Which of the following statements should be given in the blank for #Missing
Statement, if the output produced is 110?
a) global a b) global b=100 c)global b d) global a=100
13) The process of tracking the programming errors is called_________________, 1
14) Which of the following columns in a table cannot be updated? 1
a) Date type columns in the table.
b) Columns which allows NULL values in the table.
c) A primary key column which also serves as foreign key reference in
another table.
d) All of these.
15) Name the transmission media best suitable for connecting to hilly areas. 1
16) Which of the following is not a legal method for fetching records from a 1
database from within a Python program?
(a) fetchone() b)fetchtwo() (c) fetchall() (d) fetchmany()
17) Q17 and 18 are ASSERTION AND REASONING based questions. 1
Mark the correct choice as
(a) Both A and R are true and R is the correct explanation for A
(b)Both A and R are true and R is not the correct explanation for A
(c) A is True but R is False
(d)A is false but R is True
Assertion(A): CSV (Comma Separated Values) is a file format for data
storage which looks like a text file.
Reasoning(R): The information is organized with one record on each line and
each field is separated by semi-colon.
18) Assertion(A): If the arguments in a function call statement match the number 1
and order of arguments as defined in the function definition, such arguments
are called positional arguments.
Reasoning(R): During a function call, the argument list first contains default
argument(s) followed by positional argument(s).
SECTION – B 7*2=14
19) Write two points of difference between Bus topology and star topology. 2
OR
Write two points of difference between XML and HTML
20) Patra has written a code to input a number and check whether it is even or 2
odd number. His code is having errors. Rewrite the correct code and
underline the corrections made.
Def checkNumber(N):
status = N%2
return
#main-code
num=int( input(“ Enter a number to check :)).
k=checkNumber(num)
if k = 0:
print(“This is EVEN number”)
else:
print(“This is ODD number”)
21) i) Given is a Python string declaration: 2
message='FirstPreBoardExam@2022-23'
Write the output of: print(message[ : : -3].upper())
(OR)
ii) Write the output of the code given below:
d1={'rno':25, 'name':'dipanshu'}
d2={'name':'himanshu', 'age':30,'dept':'mechanical'}
d2.update(d1)
print(d2.keys())
22) Predict the output of the Python code given below: 2
L=[1,2,3,4,5]
Lst=[]
for i in range(len(L)):
if i%2==1:
t=(L[i],L[i]**2)
Lst.append(t)
print(Lst)
23) a) What are the two ways to add something to a list? How they are different? 2
(OR)
b) What are the two ways to remove something from a list? How are they different?
24) A MySQL table, sales have 10 rows. The following queries were executed on 2
the sales.
select count(*) from sales;

select count(discount) from sales;

Write a statement to explain as to why there is a difference in both the counts.


OR
What is the difference between a Candidate Key and an Alternate Key?
25) Write the output of the following: 2
L = [5,10,15,1]
G=4
def Change(X):
global G
N=len(X)
for i in range(N):
X[i] += G
Change(L)
for i in L:
print(i,end='$')
SECTION - C 5*3=15
26) Predict the output of the Python code given below: 3
def Revert(num,last=2):
if last%2==0:
last=last+1
else:
last=last-1
for c in range(1,last+1):
num+=c
print(num)
a,b=20,4
Revert(a,b)
b=b-1
Revert(b)
27) (A) Consider the following tables BOOKS and ISSUED in a database named 2+1
“LIBRARY”. Write SQL commands for the statements (i) to (iv).

i) Display book name and author name and price of computer type books.
(ii) To increase the price of all history books by Rs 50.
(iii) Show the details of all books in ascending order of their prices.
(iv) To display book id, book name and quantity issued for all books which
have been issued.
(B) Write the command to view all tables in a database.
28) Write a function countINDIA() which read a text file ‘myfile.txt’ and print the 3
frequency of the words ‘India’ in it (ignoring case of the word).
Example: If the file content is as follows:
INDIA is my country. I live in India. India has many states.
The countIndia() function should display the output as:
Frequency of India is 3
OR
Write a function countVowel() in Python, which should read each character of a text
file “myfile.txt” and then count and display the count of occurrence of vowels
(including small cases and upper case).
Example:
If the file content is as follows:
INDIA is my country. I live in India. India has many states.
The countVowel() function should display the output as:
Total number of vowels are : 20
29) Write the output of the queries (i) to (vi) based on the table given below: 3
i) Select BRAND_NAME, FLAVOUR from CHIPS where PRICE <> 10;
(ii) Select * from CHIPS where FLAVOUR=”TOMATO” and PRICE > 20;
(iii) Select BRAND_NAME from CHIPS where price > 15 and QUANTITY < 15;
(iv) Select count( distinct (BRAND_NAME)) from CHIPS;
(v) Select price , price *1.5 from CHIPS where FLAVOUR = “PUDINA”;
(vi) Select distinct (BRAND_NAME) from CHIPS order by BRAND_NAME desc;
30) A list contains following record of a student: 3
[StudentName, Class, Section, MobileNumber]
Write the following user defined functions to perform given operations on the
stack named ‘xiia’:
(i) pushElement() - To Push an object containing name and mobile number of
students who belong to class xii and section ‘a’ to the stack
(ii) popElement() - To Pop the objects from the stack and display them. Also,
display “Stack Empty” when there are no elements in the stack.
For example: If the lists of students details are:
[“Rajveer”, “99999999999”,”XI”, “B”] [“Swatantra”, “8888888888”,”XII”, “A”]
[“Sajal”,”77777777777”,”VIII”,”A”] [“Yash”, “1010101010”,”XII”,”A”]
The stack “xiia” should contain

[“Swatantra”, “8888888888”]
[“Yash”, “1010101010”]
The output should be:
[“Yash”, “1010101010”]
[“Swatantra”, “8888888888”]
Stack Empty

SECTION - D 2*4=8
31) Consider the following tables ITEM and CUSTOMER. Write SQL queries for 4
the following statements.
Table : ITEM

Table : CUSTOMER
i) To display the details of these customers whose city is Delhi.
ii) To display the details of item whose Price is in the range of 35000 to 55000
(Both values included).
iii) To display the Cx_Name, City from table Customer and Item_Name and Price
from table ITEM, with their corresponding matching I_ID.
iv) To increase the Price of all items by 1000 in the table ITEM.
32) Write a Program in Python that defines and calls the following user defined 4
functions:
(i) ADD() – To accept and add data of a teacher to a CSV file ‘teacher.csv’.
Each record consists of a list with field elements as tid, name and mobile to
store teacher id, teacher name and teacher mobile number respectively.
(ii) COUNTRECORD() – To count the number of records present in the CSV
file named ‘teacher.csv’.
SECTION - E 3*5=15
33) Aryan Infotech Solutions has set up its new center at Kamla Nagar for its 5
office and web based activities. The company compound has 4 buildings as
shown in the diagram below:
i) Suggest a cable layout of connections between the buildings.
ii) Suggest the most suitable place (i.e. building) to house the server of this
organisation with a suitable reason
iii) Suggest the placement of the following devices with justification: a. Internet
Connecting Device/Modem b. Switch
iv) The organisation is planning to link its sale counter situated in various parts of the
same city, which type of network out of LAN, MAN or WAN will be formed? Justify
your answer.
v) What do your mean by PAN? Explain giving example
34) i)Differentiate between the following: (2+3)
a) f=open(‘diary.txt’,’r’)
b) f=open(‘diary.txt’,’w’)
ii) Arif takes a student’s details (rno, name and marks) and writes into a
binary file ‘stu.dat’
(OR)
i) Explain the use of ‘Foreign Key’ in a Relational Database Management
System. Give example
ii) Sumit wants to write a code and create a binary file ‘record.dat’ with employeeid,
ename and salary. The file contains 10 records. He has to update a record based on
the employee id entered by the user and update the salary.
The updated record is then to be written in the file ‘temp.dat.’
The records which are not to be updated also have to be written to the file’ temp.dat’.
If the employee id is not found, an appropriate message should be displayed.
Help him to write a code with the above criteria
35) i) What is Referential integrity? (1+4)
ii)Shabir wants to write a program in Python to insert the following record in
the table named Student in MYSQL database, SCHOOL:
∙ rno(Roll number )- integer
∙ name(Name) - string
∙ DOB (Date of birth) – Date
∙ Fee – float
Note the following to establish connectivity between Python and MySQL:
∙ Username - root
∙ Password - tiger
∙ Host - localhost
The values of fields rno, name, DOB and fee has to be accepted from the user.
Help Shabir to write the program in Python

You might also like