CBSE Class 12 Computer Science Case Study Based Questions

Read and download the CBSE Class 12 Computer Science Case Study Based Questions in PDF format. We have provided exhaustive and printable Class 12 Computer Science worksheets for Case Study Based Questions, designed by expert teachers. These resources align with the 2025-26 syllabus and examination patterns issued by NCERT, CBSE, and KVS, helping students master all important chapter topics.

Chapter-wise Worksheet for Class 12 Computer Science Case Study Based Questions

Students of Class 12 should use this Computer Science practice paper to check their understanding of Case Study Based Questions as it includes essential problems and detailed solutions. Regular self-testing with these will help you achieve higher marks in your school tests and final examinations.

Class 12 Computer Science Case Study Based Questions Worksheet with Answers

1. Rohit, a student ofClass 12th, is learningCSVFileModule in Python.During examination, he has been assigned an incomplete Python code (shown below) to create a CSV File ‘Student.csv’
(content shown below). Help him in completing the code which creates the desired CSV File.
CSV File
1,AKSHAY,XII,A
2,ABHISHEK,XII,A
3,ARVIND,XII,A
4,RAVI,XII,A
5,ASHISH,XII,A
Incomplete Code
import_____                                             #Statement 1
fh = open(_____, _____, newline=‘ ’)       #Statement 2
stuwriter = csv._____                               #Statement 3
data = []
header = [‘ROLL_NO’, ‘NAME’, ‘CLASS’, ‘SECTION’]
data.append(header)
for i in range(5):
        roll_no = int(input(“Enter Roll Number : ”))
        name = input(“Enter Name : ”)
        class = input(“Class : ”)
        section = input(“Enter Section : ”)
        rec = [_____]                                   #Statement 4
        data.append(rec)
stuwriter. _____ (data)                            #Statement 5
fh.close()

Question. Identify the suitable code for blank space in line marked as Statement 1.
(a) csv file
(b) CSV
(c) csv
(d) Csv
Answer : C

Question. Identify the missing code for blank space in line marked as Statement 2.
(a) “School.csv”,“w”
(b) “Student.csv”,“w”
(c) “Student.csv”,“r”
(d) “School.csv”,“r”
Answer : B

Question. Choose the function name (with argument) that should be used in the blank space of linemarked as Statement 3.
(a) reader(fh)
(b) reader(MyFile)
(c) writer(fh)
(d) writer(MyFile)
Answer : C

Question. Identify the suitable code for blank space in line marked as Statement 4.
(a) ‘ROLL_NO’, ‘NAME’, ‘CLASS’, ‘SECTION’
(b) ROLL_NO, NAME, CLASS, SECTION
(c) ‘roll_no’,‘name’,‘class’,‘section’
(d) roll_no,name,class,section
Answer : D

Question. Choose the function name that should be used in the blank space of linemarked as Statement 5 to create the desired CSV file?
(a) dump()
(b) load() (
c) writerows()
(d) writerow()
Answer : C

2. Amritya Seth is a programmer, who has recently been given a task to write a Python code to perform the following binary file operations with the help of two user defined functions/modules:
(a) AddStudents() to create a binary file called STUDENT.DAT containing student information – roll number, name and marks (out of 100) of each student.
(b) GetStudents() to display the name and percentage of those students who have a percentage greater than 75. In case there is no student having percentage > 75, the function displays an appropriate message. The function should also display the average percent.
He has succeeded in writing partial code and has missed out certain statements, so he has left certain queries in comment lines. You as an expert of Python have to provide the missing statements and other related queries based on the following code of Amritya. import pickle
def AddStudents():
    ____________ #1 statement to open the binary file to write data
    while True:
        Rno = int(input(“Rno :”))
        Name = input(“Name:”)
        Percent = float(input(“Percent :”))
        L = [Rno, Name, Percent]
        ____________ #2 statement to write the list L into the file
        Choice = input(“enter more (y/n): ”)
        if Choice in “nN”:
                break
        F.close()
def GetStudents():
Total=0
Countrec=0
Countabove75=0
with open(“STUDENT.DAT”,“rb”) as F:
        while True:
                try:
____________ #3 statement to read from the file
Countrec+=1
Total+=R[2]
if R[2] > 75:
        print(R[1], “ has percent = ”,R[2])
        Countabove75+=1
except:
            break
if Countabove75==0:
                print(“There is no student who has percentage more than 75”)
        average=Total/Countrec
        print(“average percent of class = ”,average)
AddStudents()
GetStudents()

Answer any four questions (out of five) from the below mentioned questions.

Question. Which of the following commands is used to open the file “STUDENT.DAT” for writing only in binary format? (marked as #1 in the Python code)
(a) F= open(“STUDENT.DAT”,‘wb’)
(b) F= open(“STUDENT.DAT”,‘w’)
(c) F= open(“STUDENT.DAT”,‘wb+’)
(d) F= open(“STUDENT.DAT”,‘w+’)
Answer : A

Question. Which of the following commands is used to write the list L into the binary file
‘STUDENT.DAT’? (marked as #2 in the Python code)
(a) pickle.write(L,f)
(b) pickle.write(f, L)
(c) pickle.dump(L,F)
(d) f=pickle.dump(L)
Answer : C

Question. Which of the following commands is used to read each record from the binary file
‘STUDENT.DAT’? (marked as #3 in the Python code)
(a) R = pickle.load(F)
(b) pickle.read(r,f)
(c) r= pickle.read(f)
(d) pickle.load(r,f)
Answer : A

Question. Which of the following statement(s) are correct regarding the file access modes?
(a) ‘r+’ opens a file for both reading and writing. File object points to its beginning.
(b) ‘w+’ opens a file for both writing and reading. Adds at the end of the existing file, if it exists and creates a new one, if it does not exist.
(c) ‘wb’ opens a file for reading and writing in binary format. Overwrites the file, if it exists and creates a new one, if it does not exist.
(d) ‘a’ opens a file for appending. The file pointer is at the start of the file, if the file exists.
Answer : A

Question. Which of the following statements correctly explain the function of seek() method?
(a) Tells the current position within the file.
(b) Determines if you can move the file position or not.
(c) Indicates that the next read or write occurs from that position in a file.
(d) Moves the current file position to a given specified position
Answer : D

3. Krrishnav is looking for his dreamjob but has some restrictions.He lovesDelhi andwould take a job there, if he is paid over ` 40000 a month. He hates Chennai and demands at least ` 100000 to work there. In any another location, he iswilling towork for ` 60000 amonth. The following code shows his basic strategy for evaluating a job offer.
pay= _________
location= _________
if location == “Mumbai”:
        print (“I’ll take it!”)                                                   #Statement 1
elif location == “Chennai”:
if pay < 100000:
        print (“No way”)                                                      #Statement 2
else:
        print(“I am willing!”)                                                #Statement 3
elif location == “Delhi” and pay > 40000:
        print(“I am happy to join”)                                      #Statement 4
elif pay > 60000:
        print(“I accept the offer”)                                        #Statement 5
else:
        print(“No thanks, I can find something better”)      #Statement 6
On the basis of the above code, choose the right statementwhichwill be executedwhen different inputs for pay and location are given.

Question. Input: location = “Chennai”, pay = 50000
(a) Statement 1
(b) Statement 2
(c) Statement 3
(d) Statement 4
Answer : B

Question. Input: location = “Surat” ,pay = 50000
(a) Statement 2
(b) Statement 4
(c) Statement 5
(d) Statement 6
Answer : D

Question. Input : location = “Any Other City”, pay = 1
(a) Statement 1
(b) Statement 2
(c) Statement 4
(d) Statement 6
Answer : D

Question. Input : location = “Delhi”, pay = 50000
(a) Statement 6
(b) Statement 5
(c) Statement 4
(d) Statement 3
Answer : C

Question. Input : location = “Lucknow”, pay = 65000
(a) Statement 2
(b) Statement 3
(c) Statement 4
(d) Statement 5
Answer : D

4. Consider the following code and answer the questions that follow:
Book={1:‘Thriller’, 2:‘Mystery’, 3:‘Crime’, 4:‘Children Stories’}
Library ={‘5’:‘Madras Diaries’,‘6’:‘Malgudi Days’}

Question. Ramesh needs to change the title in the dictionary book from ‘Crime’ to ‘Crime Thriller’. He has written the following command:
Book[‘Crime’]=’Crime Thriller’
But he is not getting the answer. Help him choose the correct command:
(a) Book[2]=‘Crime Thriller’
(b) Book[3]=‘Crime Thriller’
(c) Book[2]=(‘Crime Thriller’)
(d) Book[3] =(‘Crime Thriller’)
Answer : B

Question. The command to merge the dictionary Book with Library the command would be:
(a) d=Book+Library
(b) print(Book+Library)
(c) Book.update(Library)
(d) Library.update(Book)
Answer : D

Question. What will be the output of the following line of code:
print(list(Library))
(a) [‘5’,‘Madras Diaries’,‘6’,‘Malgudi Days’]
(b) (‘5’,’Madras Diaries’,‘6’,‘Malgudi Days’)
(c) [‘Madras Diaries’,‘Malgudi Days’]
(d) [‘5’,‘6’]
Answer : D

Question. In order to check whether the key 2 is present in the dictionary Book, Ramesh uses the 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 must use the function Library.values() along with the in operator.
(c) We can use the Library.items() function instead of the in operator.
(d) Both (b) and (c)
Answer : B

Question. With reference to the above declared dictionaries, predict the output of the following code fragments.

""CBSE-Class-12-Computer-Science-Case-Study-Based-Questions

Answer : C

5. Arun, during Practical Examination of Computer Science, has been assigned an incomplete
search() function to search in a pickled file student.dat. The file student.dat is created by his
teacher and the following information is known about the file.
l File contains details of students in [roll_no,name,marks] format.
l File contains details of 10 students (i.e. fromroll_no 1 to 10) and separate list of each student is
written in the binary file using dump().
Arun has been assigned the task to complete the code and print details of roll number 1.
def search():
f = open(“student.dat”,____)           #Statement 1
____:                                               #Statement 2
         while True:
         rec = pickle.____                    #Statement 3
         if(____):                                  #Statement 4
                   print(rec)
except:
         pass
____                                                 #Statement 5

Question. In which mode, Arun should open the file in Statement 1?
(a) r
(b) r+
(c) rb
(d) wb
Answer : C

Question. Identify the suitable code to be used at blank space in line marked as Statement 2.
(a) if(rec[0]==1)
(b) for i in range(10)
(c) try
(d) pass
Answer : C

Question. Identify the function (with argument), to be used at blank space in line marked as Statement 3.
(a) load()
(b) load(student.dat)
(c) load(f)
(d) load(fin)
Answer : C

Question. What will be the suitable code for blank space in line marked as Statement 4.
(a) rec[0]==2
(b) rec[1]==2
(c) rec[2]==2
(d) rec[0]==1
Answer : D

Question. Which statement Arun should use at blank space in line marked as Statement 5 to close the file?
(a) file.close()
(b) close(file)
(c) f.close()
(d) close()
Answer : C

6. Radha Shah is a programmer, who has recently been given a task to write a Python code to performthe followingCSVfile operationswith the help of two user defined functions/modules:
(a) CSVOpen() : to create a CSV file called BOOKS.CSV in append mode containing information of books – Title, Author and Price.
(b) CSVRead() : to display the records from the CSV file called BOOKS.CSV where the field title starts with ‘R’.
She has succeeded in writing partial code and has missed out certain statements, so she has left certain queries in comment lines.
import csv
def CSVOpen():
with open(‘books.csv’,‘______’,newline=‘ ’) as csvf: #Statement 1
    cw=______ #Statement 2
         ______ #Statement 3
         cw.writerow([‘Rapunzel’,‘Jack’,300])
         cw.writerow([‘Barbie’,‘Doll’,900])
         cw.writerow([‘Johnny’,‘Jane’,280])
         def CSVRead():
   try:
      with open(‘books.csv’,‘r’) as csvf:
         cr=______ #Statement 4
         for r in cr:
             if ______: #Statement 5
                   print(r)
except:
         print(‘File Not Found’)
CSVOpen()
CSVRead()
You as an expert of Python have to provide the missing statements and other related queries based on the following code of Radha.

Answer any four questions (out of five) from the below mentioned questions.

Question. Choose the appropriate mode in which the file is to be opened in append mode (Statement 1).
(a) w+
(b) ab
(c) r+
(d) a
Answer : D

Question. Which statement will be used to create a csv writer object in Statement 2?
(a) csv.write(csvf)
(b) csv.writer(csvf)
(c) csvf.writer()
(d) cs.writer(csvf)
Answer : B

Question. Choose the correct option for Statement 3 to write the names of the column headings in the CSV file, BOOKS.CSV.
(a) cw.writerow(‘Title’,‘Author’,‘Price’)
(b) cw.writerow([‘Title’,‘Author’,‘Price’])
(c) cw.writerows(‘Title’,‘Author’,‘Price’)
(d) cw.writerows([‘Title’,‘Author’,‘Price’])
Answer : B

Question. Which statement will be used to read a csv file in Statement 4?
(a) cs.read(csvf)
(b) csv.reader(csvf)
(c) csvf.read()
(d) csvf.reader(cs)
Answer : B

Question. Fill in the appropriate statement to check the field Title starting with ‘R’ for Statement 5 in the above program.
(a) r[0][0]==‘R’
(b) r[1][0]==‘R’
(c) r[0][1]==‘R’
(d) r[1][1]==‘R’
Answer : A

7. Priyank is a software developer with a reputed firm. He has been given the task to computerise the operations for which he is developing a form which will accept customer data as follows:
The DATA TO BE ENTERED IS :
Name
Age
Items bought (all the items that the customer bought)
Bill amount

Question. Choose the most appropriate data type to store the above information in the given sequence.
(a) string, tuple, float, integer
(b) string, integer, dictionary, float
(c) string, integer, integer, float
(d) string, integer, list, float
Answer : D

Question. Nowthe data of each customer needs to be organised such that the customer can be identified by name followed by the age, item list and bill amount. Choose the appropriate data type that will help Priyank accomplish this task.
(a) List
(b) Dictionary
(c) Nested Dictionary
(d) Tuple
Answer : C

Question. Which of the following is the correct way of storing information of customers named ‘Paritosh’ and ‘Bhavesh’ with respect to the option chosen above?
(a) customers= {‘Paritosh’:24,[‘Printed Paper’, ‘ Penstand’], 3409, ‘Bhavesh’: 45,[‘A4 Rim’,’Printer
Cartridge’, ‘Pen Carton’, ‘Gift Wrap’], 8099.99 }
(b) customers={‘Paritosh’:[24,[‘Printed Paper’, ‘ Penstand’], 3409], ‘Bhavesh’: [45,[‘A4 Rim’,’Printer
Cartridge’, ‘Pen Carton’, ‘Gift Wrap’], 8099.99] }
(c) customers= [‘Paritosh’:24,‘Printed Paper’, ‘ Penstand’, 3409, ‘Bhavesh’: 45,‘A4 Rim’,’Printer
Cartridge’, ‘Pen Carton’, ‘Gift Wrap’, 8099.99 ]
(d) customers=(‘Paritosh’:24,[‘Printed Paper’, ‘ Penstand’], 3409, ‘Bhavesh’: 45,[‘A4 Rim’,’Printer
Cartridge’, ‘Pen Carton’, ‘Gift Wrap’], 8099.99 )
Answer : B

Question. In order to calculate the total bill amount for 15 customers, Priyank
Statement 1 must use a variable of the type float to store the sum.
Statement 2 may use a loop to iterate over the values.
(a) Both statements are correct.
(b) Statement 1 is correct, but statement 2 is not.
(c) Both statements are incorrect.
(d) Statement 1 is incorrect but statement 2 is correct.
Answer : A

8. Your teacher has given you a method/function FilterWords() in Python which read lines from a text file NewsLetter.TXT and display those words, which are lesser than 4 characters. Your teachers intentionally kept few blanks in between the code and asked you to fill the blanks, so that the code will run to find desired result. Do the needful with the following Python code.
def FilterWords():
c=0
file=open(‘NewsLetter.TXT’, ‘_____’)    #Statement 1
line = file._____                                     #Statement 2
word = _____                                         #Statement 3
for c in word:
   if _____:                                              #Statement 4
         print(c)
______                                                   #Statement 5
FilterWords()

Question. Write mode of opening the file in Statement 1?
(a) a
(b) ab
(c) w
(d) r
Answer : D

Question. Fill in the blank in Statement 2 to read the data from the file.
(a) File.Read()
(b) file.read()
(c) read.lines( )
(d) readlines( )
Answer : B

Question. Fill in the blank in Statement 3 to read data word by word.
(a) Line.Split()
(b) Line.split()
(c) line.split()
(d) split.word()
Answer : C

Question. Fill in the blank in Statement 4, which display the word having lesser than 4 characters.
(a) len(c) ==4
(b) len(c)<4
(c) len ( )= =3
(d) len ( )==4
Answer : B

Question. Fill in the blank in Statement 5 to close the file.
(a) file.close()
(b) File.Close()
(c) Close()
(d) end()
Answer : A

CBSE Computer Science Class 12 Case Study Based Questions Worksheet

Students can use the practice questions and answers provided above for Case Study Based Questions to prepare for their upcoming school tests. This resource is designed by expert teachers as per the latest 2026 syllabus released by CBSE for Class 12. We suggest that Class 12 students solve these questions daily for a strong foundation in Computer Science.

Case Study Based Questions Solutions & NCERT Alignment

Our expert teachers have referred to the latest NCERT book for Class 12 Computer Science to create these exercises. After solving the questions you should compare your answers with our detailed solutions as they have been designed by expert teachers. You will understand the correct way to write answers for the CBSE exams. You can also see above MCQ questions for Computer Science to cover every important topic in the chapter.

Class 12 Exam Preparation Strategy

Regular practice of this Class 12 Computer Science study material helps you to be familiar with the most regularly asked exam topics. If you find any topic in Case Study Based Questions difficult then you can refer to our NCERT solutions for Class 12 Computer Science. All revision sheets and printable assignments on studiestoday.com are free and updated to help students get better scores in their school examinations.

Where can I download the 2025-26 CBSE printable worksheets for Class 12 Computer Science Chapter Case Study Based Questions?

You can download the latest chapter-wise printable worksheets for Class 12 Computer Science Chapter Case Study Based Questions for free from StudiesToday.com. These have been made as per the latest CBSE curriculum for this academic year.

Are these Chapter Case Study Based Questions Computer Science worksheets based on the new competency-based education (CBE) model?

Yes, Class 12 Computer Science worksheets for Chapter Case Study Based Questions focus on activity-based learning and also competency-style questions. This helps students to apply theoretical knowledge to practical scenarios.

Do the Class 12 Computer Science Chapter Case Study Based Questions worksheets have answers?

Yes, we have provided solved worksheets for Class 12 Computer Science Chapter Case Study Based Questions to help students verify their answers instantly.

Can I print these Chapter Case Study Based Questions Computer Science test sheets?

Yes, our Class 12 Computer Science test sheets are mobile-friendly PDFs and can be printed by teachers for classroom.

What is the benefit of solving chapter-wise worksheets for Computer Science Class 12 Chapter Case Study Based Questions?

For Chapter Case Study Based Questions, regular practice with our worksheets will improve question-handling speed and help students understand all technical terms and diagrams.