The Central Board of Secondary Education (CBSE) is scheduled to administer the Class 12 Computer Science board exam on April 2, 2024. Students preparing for the exam are encouraged to visit the official CBSE website where they can access question papers from previous years. This will help them familiarize themselves with the paper pattern. Previous year papers dating back to 2019 are available on the CBSE website.

Here are some high-scoring Computer Science questions from previous year papers:

  1. Write a Python program that defines and calls the following user-defined functions:

(i) COURIER_ADD: This function prompts the user to input values and adds the details to a CSV file named ‘courier.csv’. Each record includes fields for Courier ID (cid), Sender name (s_name), Source, and destination.

(ii) COURIER_SEARCH(): This function takes the destination as input and displays all courier records going to that destination.

OR

  1. Explain the importance of closing a file before exiting. Write a Python program that defines and calls the following user-defined functions: (i) Add_Book: This function collects details of books and adds them to a CSV file named ‘Book.csv’. Each record includes fields for book ID, book name, and publisher. (ii) Search_Book: This function takes the publisher’s name as input, counts the number of books published by them, and displays the count.
  2. Shreyas, a programmer, is tasked with writing a user-defined function named ‘write_bin()’ to create a binary file named ‘Cust_file.dat’ containing customer information: customer number (c_no), name (c_name), quantity (qty), price (price), and amount (amt) for each customer. The function accepts customer number, name, quantity, and price. If the quantity entered is less than 10, it displays the message ‘Quantity less than 10….Cannot SAVE’. Otherwise, it calculates the amount as price * quantity and writes the record into the binary file. import pickle 
    def write bin():
    bin file= ___ #statement 1
    while True:
    c_no-int (input(“enter customer number”) )
    c_name=input (“enter customer name”)
    qty=int(input (“enter qty”)
    price-int (input (“‘enter price”))
    if ___#Statement  2
    print (“Quantity less than 10. .Cannot SAVE”)
    else:
    amt= price   *qty
    c_detail = [c_no, c_name, qty, price, amt]
    _____ #Statement 3
    ans-input (“Do you wish to enter more records y/n”) 
    if ans. Lower ()= =-‘n’:
    # Statement 4
    # Statement 5
    # Statement 6

Students are advised to access the complete question paper, sample papers, and marking scheme for the Computer Science exam on the official CBSE website.

Leave a Reply

Your email address will not be published. Required fields are marked *