CBSE Class 12 Computer Science Pactice Paper Set-1
CBSE Class 12 Computer Science Practice Paper Set-1
Exam Pattern Overview (2025-26)
Time: 3 Hours | Max Marks: 70
Section A: 21 MCQs (1 Mark each)
Section B: 7 Very Short Answers (2 Marks each)
Section C: 3 Short Answers (3 Marks each)
Section D: 4 Long Answers (4 Marks each)
Section E: 2 Case-based Questions (5 Marks each)
SECTION A (1 Mark each)
Select the most appropriate option.
State True or False: In Python, a tuple can be a key in a dictionary, but a list cannot.
Which of the following file modes allows you to read and write to a binary file, placing the pointer at the beginning of the file? a)
rb+b)wb+c)ab+d)w+Which SQL command is used to modify the structure (e.g., adding a column) of an existing table? a)
UPDATEb)ALTERc)MODIFYd)CHANGEAssertion (A): The
seek()method in Python is used to change the file position pointer. Reason (R):seek(offset, 0)moves the pointer relative to the end of the file. a) Both A and R are true and R is the explanation. b) Both A and R are true but R is not the explanation. c) A is true, R is false. d) A is false, R is true.Which network device is used to connect two dissimilar networks (e.g., LAN to WAN) and acts as an entry/exit point? a) Hub b) Switch c) Gateway d) Repeater
Predict the output:
PythonL = [1, 2, 3, 4] print(L[3:0:-1])a)
[4, 3, 2]b)[4, 3, 2, 1]c)[3, 2, 1]d)ErrorIdentify the valid identifier from the following: a)
returnb)My_Filec)2ndNamed)breakWhich protocol is specifically used for secure file transfer over a network? a) FTP b) SMTP c) SFTP d) POP3
What will be the output of
round(23.567, 1)? a) 23.5 b) 23.6 c) 24.0 d) 23To fetch all rows from a cursor object
curin Python-SQL connectivity, which method is used? a)cur.fetch()b)cur.fetchall()c)cur.fetchmany()d)cur.retrieve()(Q11-Q21 cover remaining MCQs on Syllabus topics like Keys in SQL, Python Exception Handling, Random Module, and Boolean Logic).
SECTION B (2 Marks each)
Very Short Answer Type
Rewrite the following code after removing all syntax errors. Underline each correction:
PythonDef check(x): if x = 10: print("Ten") Else: print("Not Ten")Differentiate between
Packet SwitchingandCircuit Switching.Write a function
Count_Vowels()in Python that reads a text fileSTORY.TXTand displays the count of vowels in it.OR Option: Write a Python function that takes a list of numbers as an argument and returns a new list containing only the numbers divisible by 5.
Expand the following abbreviations: i) VoIP ii) URL iii) SMTP iv) XML
What is the output of the following code?
Pythond = {1: "A", 2: "B", 3: "C"} print(d.get(2, "Not Found")) print(d.get(5, "Not Found"))Explain the use of the
globalkeyword with an example.
SECTION C (3 Marks each)
Short Answer Type
Database Querying: Consider the table EMPLOYEE with fields (EmpID, Name, Dept, Salary). Write SQL commands for: i) Display details of employees whose name starts with 'A'. ii) Count the number of employees in each department. iii) Increase the salary of all employees in the "IT" department by 10%.
Stack Implementation: Write a function
Push_Cust(Customer)andPop_Cust(Customer)in Python to add a new customer name to a list of customers (acting as a Stack) and remove a customer from it. The Stack should store the names of customers.File Handling (Binary): A binary file
STUDENT.DAThas structure[RollNo, Name, Marks]. Write a functionUpdate_Marks(rno)that accepts a Roll Number, searches for the record, and updates the marks of that student by adding 5 bonus marks. If the student is not found, print "Record Not Found".
SECTION D (4 Marks each)
Long Answer Type
CSV File Handling: Write a Python program to perform the following tasks using the
csvmodule: a)Add_Book(): Ask the user to enter Book_ID, Title, and Price, and write this row into a fileBOOKS.CSV. b)Search_Book(): ReadBOOKS.CSVand display the records where the Price is greater than 500.SQL + Python Connectivity: Assume a database
SCHOOLexists on a MySQL server with a tableRESULT(RollNo, Name, Grade). Write a complete Python program to:Connect to the database.
Insert a new record (Data taken from user input).
Commit the changes.
String/List Logic: Write a function
ETCount()in Python that reads a text fileNOTES.TXT. It should count and display the words that contain either the letter 'E' or 'T' (case insensitive). Example: If the file contains: "The elephant is big." Output: Words with E or T: 3 (The, elephant, is - wait, 'is' has no E/T. 'The', 'elephant' do. 'big' doesn't. Correct logic required).Networks Case Study (High Probability): "Alpha Tech" is setting up a network between its 4 wings (Admin, Sales, Tech, HR). Distances between wings are given.
Q1: Suggest the most suitable cable layout.
Q2: Suggest the placement of a Server.
Q3: Suggest the placement of a Repeater and Hub/Switch.
Q4: Which technology (Wired/Wireless) is best for connecting a branch office in a hilly area 50km away?
SECTION E (5 Marks each)
Competency/Case-based Questions
Case Study - Database (Tables & Keys): You are given two tables:
DOCTOR(DocID, Name, Specialization, HospID) andHOSPITAL(HospID, HospName, City). i) Identify the Primary Key in both tables and the Foreign Key in theDOCTORtable. ii) What is the Cardinality and Degree of theDOCTORtable if it has 5 rows? iii) Write a query to display Doctor Name and Hospital Name together (Join).Case Study - Python Modules & Random: A programmer is writing a dice game. i) Which module must be imported? ii) Write a statement using
randint()to simulate a dice roll (1-6). iii) The programmer wants to pick a random lucky winner from a list['Ali', 'Bob', 'Cat']. Which function should they use:random()orchoice()? Write the code.
Key Topics to Focus On (Last Minute Tips)
File Modes: Be clear on the difference between
w,w+,a,a+,r+.Stack: Push/Pop logic using
append()andpop().SQL:
GROUP BYcombined withHAVINGis a frequent question.Networks: Justify your answer for "Server Placement" (Rule: Place it where the maximum computers are) and "Layout" (Rule: Shortest total cable length).
Comments
Post a Comment