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

Class 12 CS Preboard 2024 25

The document is a pre-board examination paper for Class XII Computer Science at Delhi Public School Prayagraj for the academic year 2024-25. It consists of multiple sections including multiple-choice questions, coding exercises, SQL queries, and theoretical questions covering various topics in computer science. The exam has a total of 70 marks and is designed to assess students' knowledge and skills in programming, database management, and computer fundamentals.

Uploaded by

ishikasaroj49
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)
45 views5 pages

Class 12 CS Preboard 2024 25

The document is a pre-board examination paper for Class XII Computer Science at Delhi Public School Prayagraj for the academic year 2024-25. It consists of multiple sections including multiple-choice questions, coding exercises, SQL queries, and theoretical questions covering various topics in computer science. The exam has a total of 70 marks and is designed to assess students' knowledge and skills in programming, database management, and computer fundamentals.

Uploaded by

ishikasaroj49
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

DELHI PUBLIC SCHOOL PRAYAGRAJ

PRE-BOARD EXAMINATION (2024-25)


COMPUTER SCIENCE (083)
CLASS XII
M.M: 70 Time: 3 Hrs.
SECTION A (1 x 21 = 21)
1. State True or False: Name of Variable come always after the assignment operator in python. 1
2. Which of the following is valid datatype in Python? 1
(a) tuple (b) None (c) float (d)All the options
3. Give the output: 1
dic1={‘r’:’red’,’g’:’green’,’b’:’blue’}
for i in dic1:
print (i,end=’’)
(a) rGB (b) RGB (c) Rgb (d) rgb
4. Consider the given expression: 1
not True or False and True
Which of the following will be correct output if the given expression is evaluated?
(a) True (b) False (c) NONE (d) NULL
5. Select the correct output of the code: 1
a = "Year 3033 at All the best"
a = a.split('3')
b = a[0] + ". " + a[1] + ". " + a[2]
print (b)
(a) Year . 0. (c) Year 0. at All the best
(b) Year . 0. at All the best (d) Year . 0. all the best
6. Which of the following mode, file should be open if we want to add new contents in in existing file? 1
(a) a (b) r (c) w (d) None of the above
7. command is used to remove the tuple from the table in SQL. 1
(a) delete (b)remove (c) alter (d) update
8. Which of the following commands will show the structure of table from MYSQL database? 1
(a) SHOW TABLES (b) DISPLAY TABLES
(c) DESCRIBE TABLE-NAME (d)ALTER TABLE
9. Which of the following commands is used to write the list L into the binary file, 1
STUDENT.DAT indicated by file pointer f.
(a) pickle.write(L,f) (b) pickle.write(f, L) (c) pickle.dump(L,f) (d) f=pickle.dump(L)
10. Which of the following statements correctly explain the function of seek() method? 1
(a) tells the current position within the file.
(b) determines if you can move the file position or not.
(c) moves the current file position to a given specified position
(d) indicates that the next read or write occurs from that position in a file.
11. In order to check whether the key 2 is present in the dictionary Book, Ramesh uses the 1
following command: 2 in Book He gets the answer ‘True’. Now to check whether the name ‘Madras
Diaries’ exists in the dictionary Library, he uses the following command: ‘Madras
Diaries’ in Library But he gets the answer as ‘False’. Select the correct reason for this:
(a) We cannot use the in function with values. It can be used with keys only.
(b) We can use the Library.items() function instead of the in operator
(c) We must use the function Library.values() along with the in operator.
(d) Both b and c above are correct.
12. The SELECT statement when combined with clause, returns records without 1
repetition.
(a) DESCRIBE (b)ALL (c) NULL (d) DISTINCT
13. is a communication methodology designed to deliver emails over Internet protocol. 1
(a) VoIP (b) PPP (c) HTTP (d)SMTP
14. What will be the output of the following code? 1
c = 10
def add():
global c
c=c+2
print(c,end='#')
add()
c=15
print(c,end='%')
(a) 12%15# (b) 15#12% (c) 12%15# (d) 12#15%
15. Which one of the following function is an invalid multiple row function? 1
(a)sum() (b) avg() (c) count(*) (d) total()
16. Which function should be used to display the number of records as per need of a user during interface 1
with python and SQL database.
(a) fetchmany() (b) fetchone() (c) fetchall() (d) fetchfew()
17. Assertion (A): A function is block of organized and reusable code that is used to perform a 1
single, related action.
Reasoning (R):- Function provides better modularity for your application and a high degree of code
reusability.
(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
18. Assertion (A): Access mode ‘a’ opens a file for appending. 1
Reason (R): The file pointer is at the end of the file if the file exists.
(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
19. Identify the statement to delete a column phone from the table students. 1
(a) ALTER TABLE STUDENTS DROP PHONE; (b) DROP PHONE;
(c) DELETE FROM STUDENTS WHERE DROP PHONE (d) UPDATE DROP PHONE;
20. Which network device is used to connect two networks that use different protocols? 1
(a) Gateway (b) Modem (c)Switch (d)Repeater
21. State whether the following statement is True or False: 1
The finally block in Python is executed only if no exception occurs in the try block.
SECTION – B (2 x 7 = 14)
22. If L1=[1,2,3,2,4,2,4,2], and L2=[10,20,30,40], then (Answer using built-in functions only) 2
a) Write a statement to count the occurrences of 4 in L1.
b) Write a statement to remove second element from L1
23. Differentiate between append() and extend() functions. Support your answer with suitable example. 2

24. Harsh has written a code to input a number and find a table of any number. His code is having errors. 2
Rewrite the correct code and underline the corrections made.
def table()
n=int(("Enter number which table U need: ")
for i in (1,11):
print("Table of Enter no=’,i*i)
Table()
25. Identify the correct output(s) of the following code. Also write the minimum and the maximum 2
possible values of the variable b.
import random
a="Wisdom"
b=random.randint(1,6)
for i in range(0,b,2):
print(a[i],end='#')
(a) W# (b) W#i# (c) W#s# (d) W#i#s#
26. Differentiate between count() and count(*) functions in SQL with appropriate example. 2
OR
Categorize the following commands as DDL or DML: INSERT, UPDATE, ALTER, DROP
27. (a) Write an SQL command to remove the Primary Key constraint from a table, named MOBILE. 2
M_ID is the primary key of the table.
(b) Write an SQL command to make the column M_ID the Primary Key of an already existing table,
named MOBILE.
28. (a) Write the full forms of the following: (i) VoIP (ii) TCP/IP 2
(b) How is http different from https?
SECTION – C (2 x 3 = 9)
29. Write a function ShowGrades(D) that takes dictionary D {‘Name’:[Phy,Chem, Math]} as 3
argument and print grades as per following rules:
 if marks in all the subjects are 70 or above – A grade
if marks in any two subjects are 70 or above – B grade
 if marks in any one subject is 70 or above – C grade
 otherwise – E grade
30. Write a function count Dwords () in Python to count the words ending with a digit in a txt file 3
"Details. txt".
Example: If the file content is as follows:
On seat2 VIP1 wiil sit and On seatl VVIP 2 will be sitting
Output will be: Number of words ending with a digit are 4
31. A list contains following record of customer: [Customer_name, Room Type]. Write the following 3
user defined functions to perform, given operations on the stack named ‘Hotel’:
(i) Push_ Cust () - To Push customers' names of those customers who are staying in 'Delux' Room
Type.
(ii) Pop_ Cust () - To Pop the names of customers from the stack and display them. Also, display
''Underflow" when there are no ' customers in the stack.

OR
Write a function in Python, Push(Vehicle) where, Vehicle is a dictionary containing details of
vehicles - { Car Name: Maker}. The function should push the name of car manufactur by 'TATA'
(including all the possible cases like Tata, TaTa, etc.) to the stack.
For example:
If the dictionary contains the following data:
Vehicle={"Santro":"Hyundai","Nexon":"TATA","Safari":"Tata"}
The stack should contain:
Safari
Nexon
SECTION – D (4 x 4 = 16)
32. Write the outputs of the SQL queries (i) to (iv) based on the relations. COMPUTER and SALES 4
given below :

a) SELECT MIN (PRICE), MAX (PRICE) FROM COMPUTER;


b) SELECT COMPANY, COUNT (*) FROM COMPUTER GROUP BY COMPANY HAVING
COUNT (COMPANY) > 1;
c) SELECT PROD_NAME, QTY_SOLD FROM COMPUTER C, SALES S WHERE
C.PROD_ID=S.PROD_ID AND TYPE= 'INPUT';
d) SELECT PROD NAME, COMPANY, QUARTER FROM COMPUTER C SALES S WHERE C.
PROD ID=S. -'PROD ID;
OR
Consider the table ORDERS as given below

Write the following queries:


a) To display the total Quantity for each Product, excluding Products with total Quantity less than 5.
b) To display the orders table sorted by total price in descending order.
c) To display the distinct customer names from the Orders table
d) Display the sum of Price of all the orders for which the quantity is null.
33. A csv file "Happiness.csv" contains the data of a survey. Each record of the file contains the 4
following data:
(Name of a country ,Population of the country, Sample Size (Number of persons who
participated in the survey in that country) , Happy (Number of persons who accepted that
they were Happy)
For example, a sample record of the file may be: [‘Signiland’, 5673000, 5000, 3426]
Write the following Python functions to perform the specified operations on this file:
(I) Read all the data from the file in the form of a list and display all those records for which the
population is more than 5000000.
(II) Count the number of records in the file.
34. A table, named STATIONERY, in ITEMDB database, has the following structure: 4
itemNo int(11) , itemName varchar(15) price float, qty int(11)
Write the following Python function to perform the specified operation:
AddAndDisplay(): To input details of an item and store it in the table STATIONERY. The function
should then retrieve and display all records from the STATIONERY table where the Price is greater
than 120. Assume the following for Python-Database connectivity:
Host: localhost, User: root, Password: Pencil
35 (i) Why we need a binary file? 4
(ii) A binary file named “TEST.dat” has some records of the structure:
[TestId, Subject, MaxMarks, ScoredMarks]
Write a function in Python named Display AvgMarks(Sub) that will accept a subject as an
argument and read the contents of TEST.dat. The function will calculate & display the Average of
the ScoredMarks of the passed Subject on screen.
SECTION – E (5 x 2 = 10)
36. Surya is a manager working in a recruitment agency. He needs to manage the records of various 5
candidates. For this, he wants the following information of each candidate to be stored: -
Candidate_ID – integer - Candidate_Name – string - Designation – string - Experience – float
You, as a programmer of the company, have been assigned to do this job for Surya.
(I) Write a function to input the data of a candidate and append it in a binary file
(II) Write a function to update the data of candidates whose experience is more than 10 years and
change their designation to "Senior Manager".
(III) Write a function to read the data from the binary file and display the data of all those
candidates who are not "Senior Manager".
37. Quickdev, an IT based firm located in Delhi is planning to set up a Network for its four branches 1 5
within a city with its Marketing department m Kanpur. As a network professional, give solutions to
the questtion (i) to (v), after going through the branches locations and other details which are given
below :

1) Suggest the most suitable place to install the server for the Delhi t branch with a suitable reason.
2) Suggest an ideal layout for connecting all these branches within Delhi.
3) Which device will you suggest that should be placed in each of these branches to efficiently
connect all the computer within these branches?
4) Delhi firm is planning to connect to its Marketing department in Kanpur which is approximately
300 km away. Which type of network out of LAN, WAN or MAN will be formed? Justify your
answer.
5) Suggest a protocol that shall be needed to provide help for tra~sferring of files between Delhi and
Kanpur branch.

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