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

PRE CS 1 Edit

This document is a pre-board examination question paper for Computer Science for Class XII students at Amrita Vidyalayam, Thoothukudi, scheduled for January 2025. It consists of five sections with various types of questions, including multiple-choice, short answer, and programming tasks, all requiring answers in Python. The paper covers topics such as data types, file handling, SQL queries, and programming concepts.

Uploaded by

moammed
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)
171 views8 pages

PRE CS 1 Edit

This document is a pre-board examination question paper for Computer Science for Class XII students at Amrita Vidyalayam, Thoothukudi, scheduled for January 2025. It consists of five sections with various types of questions, including multiple-choice, short answer, and programming tasks, all requiring answers in Python. The paper covers topics such as data types, file handling, SQL queries, and programming concepts.

Uploaded by

moammed
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

AMRITA VIDYALAYAM SENIOR SECONDARY, THOOTHUKUDI

PRE BOARD EXAMINATION - I – JANUARY 2025


COMPUTER SCIENCE (083)
Name of the student: Time : 3 Hours
Class : XII 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 03 Short Answer type questions carrying 03 marks each.
6. Section D has 04 questions carrying 04 marks each.
7. Section E has 02 questions carrying 05 marks each.
8. All programming questions are to be answered using Python Language only.
Q No. Section-A (21x1=21Marks) Marks
1. State true or False :
A list may contain homogenous or heterogeneous elements. (1)
2. Identify the output of the following code snippet: T=(100)
(1)
print(T*2)
(A) Syntaxerror B) (200,) C) 200 D) (100,100)
3. Given s1=“Hello”.
Which of the following statements will give an error? (1)
(A) print(s1[4]) B) s2=s1 C) s1=s1[4] D) s1[4]= “Y”
4. What is the output of the expression?
(1)
s='All the Best'
p=s.split("t")
print(p)
(A) ['All','heBes',''] B) (‘All','heBes','') C) ['All','t','he','Bes','t'] D) Error
5. State True or False: (1)
“In a Python program, if a break statement is given in a nested loop, it terminates the
execution of all loops in one go.”
6. Given a Tuple tup1=(10,20,30,40,50,60,70,80, 90).
What will be the output of print (tup1[-2:-5])?
(1)
(A) (80,70,60) B) ( ) C) (60,70,80) D) Error
7. Method is used to delete a given element from the list. (1)
8. Which of the following mode in file opening statement results or generates an error if the
file does not exist?
(1)
(A) a+ B) r+ C) w+ D) None of the above
9. What will be the output of the following python dictionary operation?
(1)
data = {'A':2000, 'B':2500, 'C':3000, 'A':4000}
print(data)
A) {'A':2000,'B':2500,'C':3000,'A':4000} B) {'A':2000,'B':2500,'C':3000}
C) {'A':4000,'B':2500,'C':3000} D) It will generate an error.
10. Which of the following python statement will bring the read pointer to 10th character
from the end of a file containing 100 characters, opened for reading in binary mode? (1)

(A) File.seek(10,0) B) File.seek(-10,2) C) File.seek(-10,1) D) File.seek(10,2)


11. In which data type the data will consume the same number of bytes as declared and is right (1)
padded?

(A) DATE B) VARCHAR C) CHAR D)None of these


12. Consider the following statement:
SELECT emp_no, name FROM emp designation;
Which of the following option will be used to display the employee number and names of
similar designations together?
(1)
(A) FIELD() B) GROUP BY C) ORDER BY D)( Both(B)and(C)
13. In SQL, which operator is used to check if the column has null value / no value? (1)

14. What will be the output of the following code?


V=50
def Change(N): (1)
global V
V,N=N,V
print(V,N,sep=''#'',end=''@'') Change(20)
print(V)
(A) 20@50#20 B) 50@20#50 C) 20#50@20 D) 50#50#50
15. State whether the following statement is True or False:
(1)
An exception may be raised even if the program is syntactically correct.
16. Fill in the blank:
(1)
The modem at the sender’s computer end acts as a .
(A) Model B) Modulator C) Demodulator D) Convertor
17. Which of the following transmission media has the highest bandwidth?
(1)
(A) Coaxial cable B) Fiber optic cable C) Twisted pair cable D) None of these
18. Which of the following aggregate functions ignore NULL values? (1)
(B) max() B) count() C) avg() D) All of these
19. Which of the following is used to view emails when internet is not available? (1)
(A) SMTP B) POP3 C) PPP D) VoIP
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):To use a function from a particular module, we need to import the module.
(1)
Reasoning(R):import statement can be written anywhere in the program,before using a
function from that module.
21. Assertion(A):COUNT function ignores DISTINCT
Reasoning(R): DISTINCT ignores he duplicate values.
(1)
Q No Section-B(7x2=14 Marks) Marks
22. Predict the output of the Python code given below:
(2)
List1 = list("Examination")
List2=List1[1:-1]
new_list = []
for i in List2:
j=List2.index(i)
if j%2==0:
List1.remove(i)
print(List1)
23. Difference between compile time and runtime error. (2)
24. (A) Given is a Python string declaration: (2)
myexam="@@PREBOARDEXAMINATION2025@@"
Write the output of: print (myexam[::-2])
OR
(B) Write the output of the code given below:
my_dict = {"name": "Aman", "age": 26}
my_dict['age'] = 27
my_dict['address']="Delhi"
print(my_dict.items())
25. Find the correct output(s) of the following code. Also write the maximum and minimum
values that can be assigned to variable Y.
import random
X=random.random()
Y=random.randint(0,4) (2)
print(int(X),":",Y+ int(X))

A) 0:0 B) 1:6 C) 2:4 D) 0:3


26. A programmer has written a code to input a number and check whether it is
primeornot.Howeverthecodeishavingerrors.Rewritethecorrectcodeand underline the
(2)
corrections made.
def prime():
n=int(input("Enter number to check::")
for i in range (2, n//2):
if n % i = 0:
print("Number is not prime\n")

break
else:
print("Number is prime\n’)
27. (I) A)Write the SQL command to see the list of tables in a database.
(2)
OR
B)Write the SQL command to insert a new record in the table.

(II) A)What constraint should be applied on a table column so that NULL is not
allowed in that column, but duplicate values are allowed.
OR
B) What constraint should be applied on a table column so that duplicate values are not
allowed in that column, but NULL is allowed.
28. (a) Write the full forms of the following: (i)POP (ii) HTTPS
(2)
OR
(b) Name the protocol used for: (i) remote login (ii)file transferring
Section-C (3x3=9Marks)

29. Write a method SHOWLINES() in Python to readlines from textfile ‘EXAMCS.txt’ and
(3)
display the lines which do not contain 'ke'.
Example:
If the file content is as follows:
An apple a day keeps the doctor away.
We all pray for everyone’s safety.
A marked difference will come in our country.
The SHOWLINES() function should display the output as:

We all pray for everyone’s safety.


OR
Write a function Rain Count() in Python, which should read the content of a text file
“RAIN.txt” and then count and display the count of occurrence of word rain (case-
insensitive) in the file.
Example: If the file content is as follows:
It rained yesterday

It might rain today


I wish it rains tomorrow too
I love Rain
The Rain Count() function should display the output as : Rain – 2
30. 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
(3)
“Stack Empty” when there are no elements in the stack.
OR
Write a function in Python, Push(SItem) where, SItem is a dictionary containing
the details of stationary items– {Sname:price}.
The function should push the names of those items in the stack who have price
greater than 75. Also display the count of elements pushed into the stack.
For example:
If the dictionary contains the following data:
Ditem={"Pen":106,"Pencil":59,"Notebook":80,"Eraser":25} The
stack should contain:
Notebook Pen
The output should be:
The count of elements in the stack is 2
31. Predict the output of the following code:
s="All The Best"
n= len(s) (3)
m=""
for i in range(0,n):
if(s[i]>='a'and s[i]<='m'):

m = m +s[i].upper()
elif (s[i] >= 'n' and s[i] <= 'z'):
m = m +s[i-1]
elif (s[i].isupper()):
m=m+s[i].lower() else:
m= m+'#'
print(m)
OR
Predict the output of the following code:
F1="WoNdERFUL"
F2="StuDenTS"
F3=""
for I in range(0,len(F2)+1):
if F1[I] >= 'A' and F1<= 'F':
F3 = F3+F1[I]
elif F1[I] >= 'N' and F1[I] <= 'Z':
F3=F3+F2[I]
else:
F3=F3+"*"
print(F3)
Q No. Section-D ( 4x4=16Marks)

32. Write the output of the queries (i) to (iv) based on the table, TECH_COURSE given below:

(4)

A) Write the following queries:


(i) To display the details of the courses with names starting with ‘D’.
(ii) To display the fees of courses in descending order.
(iii) Display the sum of fees of all the courses for which TID is not null.
(iv) To display the course name with fees less than15000.
OR
B)Write the output of following queries:
(i) SELECT DISTINCT TID FROM TECH_COURSE;
(ii) SELECT TID,COUNT(*),MIN(FEES)FROM TECH_COURSE GROUPBY TID
HAVING COUNT(TID)>1;
(iii) SELECT CNAME FROM TECH_COURSE WHERE FEES > 15000
ORDERBY CNAME;
(iv) SELECT AVG(FEES) FROM TECH_COURSE WHERE FEES BETWEEN 15000
AND 17000;
33. Write a program in Python that defines and calls the following user defined functions:
a) ADD()–To accept and add data of an employee to a CSV file ‘record.csv’. Each
record consists of a list with field elements as empid, name and mobile to store (4)
employee id, employee name and employee salary respectively.
b) COUNTR()–To count the number of records present in the CSV file named
‘record.csv’.
34. Modern Public School is maintaining fees records of students. The database administrator
Aman decided that-
 Name of the database-School
 Name of the table–Fees
The attributes of Fees are as follows:
 Roll no-numeric
 Name–characterofsize20 (4)
 Class-characterofsize20
 Fees – Numeric
 Qtr– Numeric

Answer the following questions:


(i) Identify the attribute best suitable to be declared as a primary key.
(ii) Write the degree of the above table if table contains 4 rows.
(iii) Insert the following data into the attributes Rollno, Name, Class, Fees and Qtr in
fees table.
(iv) Aman want to remove the table Fees table from the database School. Which
command will he use from the following:
a) DELETE FROM Fees;
b) DROP TABLE Fees;
c) DROP DATABASE Fees;
d) DELETE Fees FROM Fees;
OR
Now Aman wants to display the structure of the table Fees, i.e, name of the attributes
and their respective data types that he has used in the table. Write the query to display the
same.
35. A table named student, in school database, has the following structure:
RollNo – integer
Name – string
Class – integer
(4)
Marks–integer
Write the following Python function to perform the specified operation: DataDisplay(): To
input details of student and store it in the table. The function should then retrieve and
displays only those records who have marks greater than 75.
Note: The following to establish connectivity between Python and MYSQL:
Username is root, Password is tiger.
Q.No. SECTIONE (2X5=10 Marks)

36. A binary file “Book.dat” has structure[BookNo, Book_Name, Author, Price] (5)
i. Write a user defined function CreateFile() to input data for a record and add to
Book.dat .
ii. Write a function CountRec(Author) in Python which accepts the Author
Name as parameter and count and return number of books by the given Author are stored
in the binary file “Book.dat”
37. Pandas infosystem has its four blocks of buildings .The number of computers and (5)
distances between the buildings is given in the diagram below:

(a) Suggest the most appropriate topology for the connection between the offices with
one advantage of it.
(b) Suggest a cable layout of connections between the buildings so that each building
is directly connected to administrative office.
(c) Suggest the most suitable place (i.e. building) to house the server with a suitable
reason.
(d) Name a device can be used to connect computers in each building.
(e) Suggest the type of protocol used for Face to Face calling between the buildings.

You might also like