0% found this document useful (0 votes)
11 views5 pages

Cs Xii QP PB 2024 25 Set I A

The document is a pre-board examination paper for Computer Science for Class XII, containing 37 questions across five sections with varying marks. It includes general instructions, question formats, and specific programming tasks related to Python and SQL. The paper emphasizes the importance of answering all questions and provides a structured approach to evaluating students' knowledge in computer science concepts.

Uploaded by

laksharuvaa
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)
11 views5 pages

Cs Xii QP PB 2024 25 Set I A

The document is a pre-board examination paper for Computer Science for Class XII, containing 37 questions across five sections with varying marks. It includes general instructions, question formats, and specific programming tasks related to Python and SQL. The paper emphasizes the importance of answering all questions and provides a structured approach to evaluating students' knowledge in computer science concepts.

Uploaded by

laksharuvaa
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
You are on page 1/ 5

कें द्रीय विद्यालय संगठन, अहमदाबाद संभाग SET-1/A s='All the Best'

KENDRIYA VIDYALAYA SANGATHAN, AHMEDABAD REGION p=s.split("t")


प्री-बोर्ड परीक्षा:2024-25 print(p)
PRE-BOARD EXAMINATION: 2024-25 (A) ['All ', 'he Bes', '']

SUBJECT : COMPUTER SCIENCE(083) TIME : 3 HOURS (B) (‘All ', 'he Bes', '')
CLASS : XII MM : 70 (C) ['All ', 't', 'he', 'Bes', 't']
----------------------------------------------------------------------------------------------------
(D) Error
सामान्यवनदेश/GENERAL INSTRUCTIONS:
6 Given a Tuple tup1= (10, 20, 30, 40, 50, 60, 70, 80, 90). (1)
 This question paper contains 37 questions.
What will be the output of print (tup1 [-2: -5])?
 All questions are compulsory. However, internal choices have been provided in some
(A) (80,70,60)
questions. Attempt only one of the choices in such questions
(B) ( )
 The paper is divided into 5 Sections- A, B, C, D and E.
(C) (60,70,80)
 Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
(D) Error
 Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
7 What will be the output of the following python dictionary operation? (1)
 Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
data = {'A':2000, 'B':2500, 'C':3000, 'A':4000}
 Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
print(data)
 Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
(A) {'A':2000, 'B':2500, 'C':3000, 'A':4000}
 All programming questions are to be answered using Python Language only.
(B) {'A':2000, 'B':2500, 'C':3000}
 In case of MCQ, text of the correct answer should also be written.
(C) {'A':4000, 'B':2500, 'C':3000}
(D) It will generate an error.
Q.NO SECTION-A(21x1=21 Marks) MARKS 8 _______ method is used to delete a given element from the list. (1)

1 State True or False: (1) 9 Which of the following mode in file opening statement results or generates an (1)
“In a Python program, if a break statement is given in a nested loop, it error if the file does not exist?
terminates the execution of all loops in one go.”
(A) a+
2 Identify the output of the following code snippet: (1) (B) r+
T=(100) (C) w+
print(T*2) (D) None of the above
(A) Syntax error 10 Which of the following python statement will bring the read pointer to 10th (1)
(B) (200,) character from the end of a file containing 100 characters, opened for reading
(C) 200 in binary mode.
(D) (100,100) (A) File.seek(10,0)
3 Given s1=“Hello”. Which of the following statements will give an error? (1) (B) File.seek(-10,2)
(A) print(s1[4]) (C) File.seek(-10,1)
(B) s2=s1 (D) File.seek(10,2)
(C) s1=s1[4] 11 State whether the following statement is True or False: (1)
(D) s1[4]= “Y” An exception may be raised even if the program is syntactically correct.
4 Write the output of following expression: (1) 12 What will be the output of the following code? (1)
5>10 and not(10<15)
V = 50
5 What is the output of the expression? (1)
def Change(N):
Page 1 of 10 Page 2 of 10
global V (C) Demodulator
V,N = N,V (D) Convertor
print(V,N,sep=''#'', end=''@'') 19 Which of the following transmission media has the highest bandwidth? (1)
Change(20) (A) Co axial cable
print(V) (B) Fiber optic cable
(A) 20@50#20 (C) Twisted pair cable
(B) 50@20#50 (D) None of these
(C) 20#50@20 Q20 and Q21 are Assertion(A) and Reason(R) based questions. Mark the
(D) 50#50#50 correct choice as: (A)Both A and R are true and R is the correct explanation
13 In SQL, which operator is used to check if the column has null value/no (1) for A (B)Both A and R are true and R is not the correct explanation for A (C)A
value? is True but R is False (D)A is False but R is True
14 Consider the following statement: (1) 20 Assertion (A): To use a function from a particular module, we need to import (1)
SELECT emp_no, name FROM emp ________ designation; the module.
Which of the following option will be used to display the employee number Reasoning (R): import statement can be written anywhere in the program,
and names of similar designations together? before using a function from that module.
(A) FIELD() 21 Assertion (A): COUNT function ignores DISTINCT (1)
(B) GROUP BY Reasoning (R): DISTINCT ignores the duplicate values.
(C) ORDER BY Q.NO SECTION-B(7x2=14 Marks) MARKS
(D) Both (B) and (C) 22 Predict the output of the Python code given below: (2)
15 In which datatype the data will consume the same number of bytes as (1) List1 = list("Examination")
declared and is right padded? List2 =List1[1:-1]
(A) DATE new_list = []
(B) VARCHAR for i in List2:
(C) CHAR j=List2.index(i)
(D) None of these if j%2==0:
16 Which of the following aggregate functions ignore NULL values? (1) List1.remove(i)
(A) max() print(List1)
(B) count() 23 Difference between compile time and run time error. (2)
(C) avg() 24 (A)Given is a Python string declaration: (2)
(D) All of these myexam="@@PRE BOARD EXAMINATION 2024@@"
17 Which of the following is used to view emails when internet is not available? (1) Write the output of: print(myexam[::-2])
(A) SMTP OR
(B) POP3 (B)Write the output of the code given below:
(C) PPP my_dict = {"name": "Aman", "age": 26}
(D) VoIP my_dict['age'] = 27
18 Fill in the blank: (1) my_dict['address'] = "Delhi"
The modem at the sender’s computer end acts as a ____________. print(my_dict.items())
(A) Model 25 Find the correct output(s) of the following code. Also write the maximum and (2)
(B) Modulator
Page 3 of 10 Page 4 of 10
minimum values that can be assigned to variable Y. The SHOWLINES() function should display the output as:
import random We all pray for everyone’s safety.
X=random.random() OR
Y=random.randint(0,4) Write a function RainCount() in Python, which should read the content of a
print (int(X),":",Y+int(X)) text file “RAIN.txt” and then count and display the count of occurrence of
(A) 0:0 word rain (case-insensitive) in the file.
(B) 1:6 Example: If the file content is as follows:
(C) 2:4 It rained yesterday
(D) 0:3 It might rain today
26 A programmer has written a code to input a number and check whether it is (2) I wish it rains tomorrow too
prime or not. However the code is having errors. Rewrite the correct code and I love Rain
underline the corrections made. The RainCount() function should display the output as: Rain – 2
def prime(): 30 A list contains following record of a customer: (3)
n=int(input("Enter number to check :: ") [Customer_name, Phone_number, City]
for i in range (2, n//2): Write the following user defined functions to perform given operations on the
if n%i=0: stack named status:
print("Number is not prime \n") (i) Push_element() - To Push an object containing name and Phone number of
break customers who live in Goa to the stack.
else: (ii) Pop_element() - To Pop the objects from the stack and display them. Also,
print("Number is prime \n’) display “Stack Empty” when there are no elements in the stack.
27 (I) A) Write the SQL command to see the list of tables in a database. (2) OR
OR Write a function in Python, Push(SItem) where , SItem is a dictionary
B) Write the SQL command to insert a new record in the table. containing the details of stationary items– {Sname:price}.
The function should push the names of those items in the stack who have
(II) A) What constraint should be applied on a table column so that NULL is price greater than 75. Also display the count of elements pushed into the
not allowed in that column, but duplicate values are allowed. stack.
OR For example:
B) What constraint should be applied on a table column so that duplicate If the dictionary contains the following data:
values are not allowed in that column, but NULL is allowed. Ditem={"Pen":106,"Pencil":59,"Notebook":80,"Eraser":25}
28 (a) Write the full forms of the following: (i) POP (ii) HTTPS (2) The stack should contain:
OR Notebook
(b) Name the protocol used for : (i)remote login (ii) file transferring Pen
Q.NO SECTION-C(3x3=9 Marks) MARKS The output should be:
29 Write a method SHOWLINES() in Python to read lines from text file (3) The count of elements in the stack is 2
31 Predict the output of the following code: (3)
‘EXAMCS.txt’ and display the lines which do not contain 'ke'.
s="All The Best"
Example: If the file content is as follows:
n = len(s)
An apple a day keeps the doctor away.
m=""
We all pray for everyone’s safety.
for i in range(0, n):
A marked difference will come in our country.
Page 5 of 10 Page 6 of 10
if (s[i] >= 'a' and s[i] <= 'm'): (ii) SELECT TID, COUNT(*), MIN(FEES) FROM TECH_COURSE GROUP BY TID
m = m +s[i].upper() HAVING COUNT(TID)>1;
elif (s[i] >= 'n' and s[i] <= 'z'): (iii) SELECT CNAME FROM TECH_COURSE WHERE FEES>15000 ORDER BY
m = m +s[i-1] CNAME;
elif (s[i].isupper()): (iv) SELECT AVG(FEES) FROM TECH_COURSE WHERE FEES BETWEEN 15000
m = m + s[i].lower() AND 17000;
else: 33 Write a program in Python that defines and calls the following user defined (4)
m = m +'#' functions:
print(m) a) ADD() – To accept and add data of an employee to a CSV file ‘record.csv’.
OR Each record consists of a list with field elements as empid, name and mobile
Predict the output of the following code: to store employee id, employee name and employee salary respectively.
F1="WoNdERFUL" b) COUNTR() – To count the number of records present in the CSV file named
F2="StuDenTS" ‘record.csv’.
F3="" 34 Modern Public School is maintaining fees records of students. The database (4)
for I in range(0,len(F2)+1): administrator Aman decided that-
if F1[I]>='A' and F1<='F':  Name of the database -School
F3=F3+F1[I]  Name of the table – Fees
elif F1[I]>='N' and F1[I]<='Z': The attributes of Fees are as follows:
F3=F3+F2[I]  Rollno - numeric
else:  Name – character of size 20
F3=F3+"*"  Class - character of size 20
print(F3)  Fees – Numeric
Q.NO SECTION-D(4x4=16 Marks) MARKS  Qtr – Numeric
32 Write the output of the queries (i) to (iv) based on the table, TECH_COURSE (4)
given below: 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) (A) Aman want to remove the table Fees table from the database School.
Which command will he use from the following:
A) Write the following queries:
a) DELETE FROM Fees;
(i) To display the details of the courses with names starting with ‘D’.
b) DROP TABLE Fees;
(ii) To display the fees of courses in descending order.
c) DROP DATABASE Fees;
(iii) Display the sum of fees of all the courses for which TID is not null.
d) DELETE Fees FROM Fees;
(iv) To display the course name with fees less than 15000.
OR
OR
(iv) (B) Now Aman wants to display the structure of the table Fees, i.e, name
B) Write the output of following queries:
of the attributes and their respective data types that he has used in the table.
(i) SELECT DISTINCT TID FROM TECH_COURSE;
Write the query to display the same.

Page 7 of 10 Page 8 of 10
35 A table named student, in school database, has the following structure: (4)
RollNo – integer
Name – string
Class – integer
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: As a network expert, provide the best possible answer for the following

Username is root , Password is tiger. queries:

Q.NO SECTION-E(2x5=10 Marks) MARKS i) Draw the cable layout to efficiently connect various buildings.

36 A binary file “Book.dat” has structure [BookNo, Book_Name, Author, Price] (5) ii) Suggest the most appropriate location of the server. Justify your choice.

i. Write a user defined function CreateFile() to input data for a record and add iii) Suggest the placement of the following device with justification:

to Book.dat . a) Repeater b) Hub/Switch

ii. Write a function CountRec(Author) in Python which accepts the Author iv) Suggest a system (hardware/software) to prevent unauthorized access to

name as parameter and count and return number of books by the given or from the network.

Author are stored in the binary file “Book.dat” v) A) Which cable is best suited for above layout.

37 Reha Medicos Center has set up its new center in Dubai. It has four buildings (5) OR

as shown in the diagram given below: B) What type of network (PAN, LAN, MAN, or WAN) will be set up
among the computers connected with each other?

************

Distance between various building are as follows:

Page 9 of 10 Page 10 of 10

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy