0% found this document useful (0 votes)
420 views8 pages

VV Pad-Gr 12 Cs QP Set 1

Uploaded by

kr200725
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)
420 views8 pages

VV Pad-Gr 12 Cs QP Set 1

Uploaded by

kr200725
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

VELAMMAL VIDHYASHRAM, PADAPPAI

GRADE 12 - PREBOARD EXAM (2024-2025)


COMPUTER SCIENCE (083)
Time allowed: 3 Hours Maximum Marks: 70
General Instructions:
All questions are compulsory. However, internal choices have been provided in some
questions. Attempt only one of the choices in such questions
The paper is divided into 5 Sections- A, B, C, D and E.
Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
All programming questions are to be answered using Python Language only.
In case of MCQ, text of the correct answer should also be written.
Section-A (21 x 1 = 21 Marks)
1. x=3.123, then int (x) will give?
a) 3.1 b) 0 c) 1 d) 3
2. What will be the output of the operation print("\\\\\\") ?
a) \\\\\\ b) \\\ c) \\ d) Error
3. What will be the output of the expression print(10+20*10//2**3-5)
a) 30 b) 40 c) 1005 d) 130
4. What will be the result of the expression True or False and not True or True
a) True b) False c) None d) Error
5. What will be the output of the following program?
a = {'A':10,'B':20}
b = {'B':20, 'A':10}
print(a==b and a is b)
a) True b) False c) None d) Error
6. What is the output of print("hello".find('E'))?
a) 1 b) 2 c) -1 d) Error
7. For the given list d=[10,30,20,15,45,50,80,90] what will be the output of the following slicing
operation: d[2:7:2]
a) [20,15,45] b) [20, 45, 80] c) [30, 15, 50] d) [20, 45]
8. State True or False:
Logical operator not has highest precedence among all the logical operators.
9. Study the following program and select the possible output:
import random
x=random.random()
y=random.randint(0,4)
print(int(x),":",y+int(x))
a) -1:0 b) 1:6 c) 2:4 d) 0:3
10. Which of the following functions header is correct?
a) def study(a=2, b=5, c) : b) def study(a=2, b, c=5) :
c) def study(a, b=2, c=5): d) none of the above
11. Which block is a mandatory block in exception handling process?
(a) try (b) except (c) finally (d) else
12. The code which might raise an exception is kept in .................. block.
13. Which statement is used to change the file position to an offset value from the start?
(a) fp.seek(offset,0) (b) fp.seek(offset,1) (c) fp.seek(offset,2) (d) None of these
14. Which module is required to use the built-in function dump() ?
(a) math (b) flush (c) pickle (d) unpickle
15. _______Address is assigned to network cards by manufacturer
a. IP b. MAC c. unique d. domain
16. A _________ is a network device that connects dissimilar networks.
(A) Bridge (B) Gateway (C) Hub (D) Switch
17. Which of the following represents the fastest data transmission speed?
a) Kbps b) Bps c) Gbps d) Mbps
18. Which keyword is used for aliasing a table?
a) ASC b) AS c) IS d) None of these
19. Which is the following not a DML command ?
(a) SELECT (b) UPDATE (c) DELETE (d) CREATE
Q20 and Q21 are Assertion(A) and Reason(R) based questions. 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
20. Assertion(A): While inserting records in EMP table, value of DateOfBirth field must be enclosed
withing quotes ‘ ‘.
Reasoning(R): Date is represented as char / varchar always.
21. Assertion (A):- If the arguments in a function call statement match the number 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 x 2=14 Marks)


22. Predict the output of the Python code Given below:
def Sum(N1,N2):
if N1>N2:
return N1-N2
else:
return N2-N1
lst= [20,25,24,34,35]
for C in range (3,0,-1):
A=lst[C]
B=lst[C-1]
print(Sum(A,B),end='#')
else:
print("\nend of the program".title())

23. Rewrite the following code in python after removing all syntax error(s). Underline each correction
done in the code.
250 = Number
WHILE Number<=1000:
if Number=>750:
print(Number)
Number=Number+100
else
print(Number*2)
Number=Number+50

24. Write a function displayCity(CITIES) in Python, that takes the list, CITIES as an argument and displays
the names (in uppercase)of the cities whose names are smaller than 7 characters.
For example, Consider the following list
CITIES=["Delhi","Kolkata","Mumbai","Bangalore","Pune"]
The output should be
Delhi
Mumbai
Pune

OR

Write a function countStudents(Scores) in Python, that takes the dictionary, Scores as an argument and
displays the count of the students whose scores are greater than 70.
For example, Consider the following dictionary
Scores={'Reena':80,'Ajay':50,'Vijay':90,'Geeta':40,'Ritu':80,'Deepak':75}
The output should be
Count of students scoring>70 : 4

25. Write the Python statement for each of the following tasks:
(a) to delete the element from beginning of the list ‘L’
(b) to insert the elements of list ‘L1’ as individual elements in list ‘L’

26. Predict the output of the following code


tup = ('vel',)
n=3
for i in range(int(n)):
tup = (tup,)
print(tup)

27. How many pair of wires are there in twisted pair cable (Ethernet)?What is the name of port, which is
used to connect Ethernet cable to a computer or a labtop?
OR
Differentiate between static and dynamic website

28. Mr. Gangesh has just created a table named “Products” containing columns
Pcode, Pname, Price and Quantity. Mistakenly he has taken char datatype for the column “Quantity”. Now
he wants to change datatype for column “Quantity” to integer. Help him in writing the SQL command to
make necessary change in the table “Products”. Also, write the command to insert the following record in
the table:
Pcode- 3345
Pname- Chair
Price: 500
Quantity: 100

OR
Janani has created the following table with the name ‘Order’.

One of the rows inserted is as follows :


(i) What is the data type of columns OrderId and OrderDate in the table Order ?
(ii) Anita is now trying to insert the following row :

Will she be able to successfully insert it ? Give reason.

Section-C ( 3 x 3 = 9 Marks)
29. Predict the output of the Python code Given below:
def fun_para(x=5,y=10,z=1005):
z=x/2
res=y//x+z
return res
a,b,c=20,10,1509
print(fun_para(),fun_para(b),sep='#')
res=fun_para(10,20,6015)
print(res, "@")
print(fun_para(z=999,y=b,x=5), end="#@")

30. Write a function, WordCount() in Python to read a text file, “story.txt”, and display those words in it
that begin with consonants and end with vowels. Also, the function will count those words and return
how many such numbers are in the same text file.
OR
Write function in Python COUNTING () which will count “The” word from text file “Book.txt”.

31. A dictionary, StudRec, contains the records of students in the following pattern:
{admno: [m1, m2, m3, m4, m5]}, i.e., Admission No. (admno) as the key and 5 subject marks in the list as
the value.
Each of these records is nested together to form a nested dictionary. Write the following user-defined
functions in the Python code to perform the specified operations on the stack named BRIGHT.
(i) Push_Bright(StudRec): it takes the nested dictionary as an argument and pushes a list of dictionary
objects or elements containing data as {admno: total (sum of 5 subject marks)} into the stack named
BRIGHT of those students with a total mark >350.
(ii) Pop_Bright(): It pops the dictionary objects from the stack and displays them. Also, the function should
display “Stack is Empty” when there are no elements in the stack.
For Example: if the nested dictionary StudRec contains the following data:
StudRec={101:[80,90,80,70,90], 102:[50,60,45,50,40], 103:[90,90,99,98,90]}
Thes Stack BRIGHT Should contain: [{101: 410}, {103: 467}]
The Output Should be: {103: 467}
{101: 410}
If the stack BRIGHT is empty then display: Stack is Empty
OR
A list contains following record of a customer: [Customer_name, Phone_number, City]
Write the following user defined functions to perform given operations on the stack named ‘status’:
(i) Push_element() - To Push an object containing name and Phone number of customers who live in Goa
to the stack (ii) Pop_element() - 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 customer details are:
[“Gurdas”, “99999999999”,”Goa”]
[“Julee”, “8888888888”,”Mumbai”]
[“Murugan”,”77777777777”,”Cochin”]
[“Ashmit”, “1010101010”,”Goa”]
The stack should contain
[“Ashmit”,”1010101010”]
[“Gurdas”,”9999999999”]
The output should be:
[“Ashmit”,”1010101010”]
[“Gurdas”,”9999999999”]
Stack Empty

Section-D ( 4 x 4 = 16 Marks)
32.
Table Name: TRADERS
TCODE TNAME CITY
T01 RELIANCE DIGITAL MUMBAI
T02 TATA DIGITAL BHUBANESWAR
T03 BIRLA DIGITAL NEW DELHI
Table name: STOCK
SCODE SNAME QTY PRICE BRAND TCODE
1001 COMPUTER 90 45000 DELL T01
1006 LCD PROJECTOR 40 42000 NEC T02
1004 IPAD 100 55000 APPLE T01
1003 DIGITAL CAMERA 160 15000 SAMSUNG T02
Write SQL queries for the following:
(i) Display the SNAME, QTY, PRICE, TCODE, and TNAME of all the stocks in the STOCK and TRADERS tables.
(ii) Display the details of all the stocks with a price >= 35000 and <=50000 (inclusive).
(iii) Display the SCODE, SNAME, QTY*PRICE as the “TOTAL PRICE” of BRAND “NEC” or “HP” in ascending
order of QTY*PRICE.
(iv) Display TCODE, TNAME, CITY and total QTY in STOCK and TRADERS in each TCODE.

33. Mr. Akshay is a software engineer working at TCS. He has been assigned to develop code for stock
management; he has to create a CSV file named stock.csv to store the stock details of different
products.The structure of stock.csv is : [stockno, sname, price, qty], where stockno is the stock serial
number (int), sname is the stock name (string), price is stock price (float) and qty is quantity of stock(int).
Mr. Snehant wants to maintain the stock data properly, for which he wants to write the following user-
defined functions:
AcceptStock() – to accept a record from the user and append it to the file stock.csv. The column headings
should also be added on top of the csv file. The number of records to be entered until the user chooses ‘Y’
/ ‘Yes’.
StockReport() – to read and display the stockno, stock name, price, qty and value of each stock as
price*qty. As a Python expert, help him complete the task.
34. Consider the table TRAINER as given below.

TRAINER
TID TNAME CITY HIREDATE SALARY
101 SUNAINA MUMBAI 1998-10-15 90000
102 ANAMIKA DELHI 1994-12-24 80000
103 DEEPTI CHANDIGARG 2001-12-21 82000
104 MEENAKSHI DELHI 2002-12-25 78000
105 RICHA MUMBAI 1996-01-12 95000
106 MANIPRABHA CHENNAI 2001-12-12 69000

(i) Display the Trainer Name, City & Salary in descending order of their Hiredate.
(ii) To display the TNAME and CITY of Trainer who joined the Institute in the month of December 2001.
(iii) To display TNAME, HIREDATE, CNAME, STARTDATE from tables TRAINER and COURSE
of all those courses whose FEES is less than or equal to 10000.
(iv) To display number of Trainers from each city.

OR

(v) SELECT TID, TNAME, FROM TRAINER WHERE CITY NOT IN(‘DELHI ’, ‘MUMBAI ’);
(vi) SELECT DISTINCT CITY FROM TRAINER;
(vii) SELECT CITY, COUNT(*) FROM TRAINER GROUP BY CITY HAVING COUNT(*)>1;
(viii) SELECT COUNT(*), SUM(SALARY) FROM TRAINER WHERE HIREDATE< ‘ 1998-01-01 ’;

35. The code given below reads the following record from Table named Employee and display those
record salary >= 30000 and <= 90000:
Empno – integer
EName – string
Desig – integer
Salary – integer
Note the following to establish connectivity between Python and MYSQL:
Username is root
Password is Password
The table exists in a MYSQL database named Bank.
Write the following missing statements to complete the code on behalf of your friend Sandeep:
Statement 1 – to form the cursor object
Statement 2 – to query string.
Statement 3 - to execute the query that extracts records of those Employees whose salary >=30000
and <=90000.
Statement 4 - to close the connection.
import mysql.connector
mydb=mysql.connector.connect(host='localhost',user='root',passwd='Password',database='bank')
mycursor=_________________ # statement1
mycursor.________________ #statement 2
data= __________________ # statement 3
for x in data:
print(x)
______________ # statement 4
SECTION E (2 X 5 = 10 Marks)

36. FutureTech Corporation, a Bihar based IT training and development company, is planning to
set up training centers in various cities in the coming year. Their first center coming up in
Surajpur district. At Surajpur center, they are planning to have 3different blocks - one for Admin,
one for Training and one for Development. Each block has number of computers, which are
required to be connected in a network for communication, data and resource sharing. As a
network consultant of this company,you have to suggest the best network related solutions for
them for issues/problems raised in question nos. (i) to (v), keeping in mind the distances between
various blocks/locations and other given parameters.

(i) Suggest the most appropriate block/location to house the SERVER in the Surajpur center (out
of the 3 blocks) to get the best and effective connectivity. Justify your answer.
(ii) Suggest why should a firewall be installed at the Surajpur Center?
(iii) Suggest the best wired medium and draw the cable layout (Block to Block) to most efficiently
connect various blocks within the Surajpur Center.
(iv) Suggest the placement of the following devices with appropriate reasons:
a) Switch/Hub b) Router
(v) Suggest the best possible way to provide wireless connectivity between Surajpur Center
and Raipur Center.

37. A binary file “student.dat” has structure [rollno, name, marks].


i. Write a user defined function insertRec() to input data for a student and add to student.dat.
ii. Write a function searchRollNo(r) in Python which accepts the student’s rollno as parameter and
searches the record in the file “student.dat” and shows the details of student i.e. rollno, name and
marks (if found) otherwise shows the message as ‘No record found’.

-----------------------------------------------------

You might also like