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.

  1. State True or False: In Python, a tuple can be a key in a dictionary, but a list cannot.

  2. 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+

  3. Which SQL command is used to modify the structure (e.g., adding a column) of an existing table? a) UPDATE b) ALTER c) MODIFY d) CHANGE

  4. Assertion (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.

  5. 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

  6. Predict the output:

    Python
    L = [1, 2, 3, 4]
    print(L[3:0:-1])
    

    a) [4, 3, 2] b) [4, 3, 2, 1] c) [3, 2, 1] d) Error

  7. Identify the valid identifier from the following: a) return b) My_File c) 2ndName d) break

  8. Which protocol is specifically used for secure file transfer over a network? a) FTP b) SMTP c) SFTP d) POP3

  9. What will be the output of round(23.567, 1)? a) 23.5 b) 23.6 c) 24.0 d) 23

  10. To fetch all rows from a cursor object cur in Python-SQL connectivity, which method is used? a) cur.fetch() b) cur.fetchall() c) cur.fetchmany() d) cur.retrieve()

  11. (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

  1. Rewrite the following code after removing all syntax errors. Underline each correction:

    Python
    Def check(x):
       if x = 10:
          print("Ten")
       Else:
          print("Not Ten")
    
  2. Differentiate between Packet Switching and Circuit Switching.

  3. Write a function Count_Vowels() in Python that reads a text file STORY.TXT and displays the count of vowels in it.

  4. 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.

  5. Expand the following abbreviations: i) VoIP ii) URL iii) SMTP iv) XML

  6. What is the output of the following code?

    Python
    d = {1: "A", 2: "B", 3: "C"}
    print(d.get(2, "Not Found"))
    print(d.get(5, "Not Found"))
    
  7. Explain the use of the global keyword with an example.


SECTION C (3 Marks each)

Short Answer Type

  1. 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%.

  2. Stack Implementation: Write a function Push_Cust(Customer) and Pop_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.

  3. File Handling (Binary): A binary file STUDENT.DAT has structure [RollNo, Name, Marks]. Write a function Update_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

  1. CSV File Handling: Write a Python program to perform the following tasks using the csv module: a) Add_Book(): Ask the user to enter Book_ID, Title, and Price, and write this row into a file BOOKS.CSV. b) Search_Book(): Read BOOKS.CSV and display the records where the Price is greater than 500.

  2. SQL + Python Connectivity: Assume a database SCHOOL exists on a MySQL server with a table RESULT (RollNo, Name, Grade). Write a complete Python program to:

    1. Connect to the database.

    2. Insert a new record (Data taken from user input).

    3. Commit the changes.

  3. String/List Logic: Write a function ETCount() in Python that reads a text file NOTES.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).

  4. 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

  1. Case Study - Database (Tables & Keys): You are given two tables: DOCTOR (DocID, Name, Specialization, HospID) and HOSPITAL (HospID, HospName, City). i) Identify the Primary Key in both tables and the Foreign Key in the DOCTOR table. ii) What is the Cardinality and Degree of the DOCTOR table if it has 5 rows? iii) Write a query to display Doctor Name and Hospital Name together (Join).

  2. 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() or choice()? 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() and pop().

  • SQL: GROUP BY combined with HAVING is 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

Popular Posts