CBSE Class 12 CS 083 Board Question Paper 2024-25 with Solution

Preparing for the CBSE Class 12 Computer Science (Code 083) Board Exam 2024–25 becomes much more effective when students practice previous year question papers with complete solutions. These papers help students understand the actual exam pattern, types of questions, marking scheme, and important topics frequently asked by CBSE. By solving them, students can identify their strengths and weaknesses, improve time management skills, and get familiar with the level of difficulty they can expect in the final exam. This practice builds confidence and reduces exam stress significantly.

Class-12-CS-083-CBSE-Board-Previous-Year-Question-Paper-2024-25-with-Solution

Moreover, Class 12 Computer Science Code 083 Previous Year Question Papers with Complete Solutions act as a powerful revision tool. Detailed solutions not only provide the correct answers but also explain the logic and concepts behind them, helping students strengthen their understanding of programming concepts, SQL queries, and theoretical topics. Regular practice ensures better accuracy, fewer mistakes, and a clearer approach to answering questions in the board exam. Overall, it is one of the smartest strategies for scoring high marks in CBSE Class 12 Computer Science.

CBSE CLASS 12 COMPUTER SCIENCE (083) - SOLUTION

Class 12 CS (Code 083) - Previous Year Question Paper
(Session 2024-25)

Exam Date: March 29th, 2025
Series ZYW1X
Question Paper Code 91 Set 4

Time allowed : 3 hours
Maximum Marks : 70

General Instructions:
  1. This question paper contains 37 questions and five sections, Section A to E.
  2. All questions are compulsory.
  3. Section A have 21 questions carrying 1 mark each.
  4. Section B has 7 Very Short Answer type questions carrying 2 marks each.
  5. Section C has 3 Short Answer type questions carrying 3 marks each.
  6. Section D has 4 Long Answer type questions carrying 4 marks each.
  7. Section E has 2 questions carrying 5 marks each.
  8. All programming questions are to be answered using Python Language only.
  9. In case of MCQs, text of the correct answer should also be written.
SECTION A (21x1=21)

1. State True or False:
“A Python list must always contain all its elements of Same data type.”
Ans: False

2. What will be the output of the following statement?
print (14%3**2*4)
a) 16
b) 64
c) 20
d) 256

3. Identify the correct output of the following code snippet.
game="Olympic2024"
print(game.index("C"))
a) 0
b) 6
c) -1
d) ValueError

4. Which of the following is the correct identifier?
a) global
b) Break
c) def
d) with

5. Identify the invalid Python statement out of the following options.
a) print("A",10,end="*")
b) print("A",sep="*",10)
c) print("A",10,sep="*")
d) print("A"*10)

6. Consider the statements given below and then choose the correct output from the given options:
L=['TIC,'TAC']
print(L[::-1])
a) ['CIT', 'CAT']
b) ['TIC', 'TAC']
c) ['CAT', 'CIT']
d) ['TAC', 'TIC']

7. Which of the following operator evaluates to True if the variable on either side of the operator points towards the same memory location and False otherwise?
a) is
b) is not
c) and
d) or

8. Consider the statements given below and then choose the correct output from the given options:
D={'S01':95, 'S02':96}
for I in D :
   print(I, end='#')
a) S01#S02#
b) 95#96#
c) S01,95#S02,96#
d) S01#95#S02#96#

9. While creating a table, which constraint does not allow insertion of duplicate values in the table?
a) UNIQUE
b) DISTINCT
c) NOT NULL
d) HAVING

10. Consider the statements given below and then choose the correct output from the given options:
def Change(N):
    N=N+10
    print(N,end='$$')
N=15
Change(N)
print(N)
a) 25$$15
b) 15$$25
c) 25$$25
d) 2525$$

11. Consider the statements given below and then choose the correct output from the given options:
N='5'
try:
    print('WORD' +N, end='#')
except:
    print('ERROR', end='#')
finally:
    print('OVER')
a) ERROR#
b) WORD5#OVER
c) WORD5#
d) ERROR#OVER

12. Which of the following built-in function / method returns or dictionary?
a) dict()
b) keys()
c) values()
d) items()

13. Which of the following is a DML command in SQL?
a) UPDATE
b) CREATE
c) ALTER
d) DROP

14. Which aggregate function in SQL displays the number of values in the specified column ignoring the NULL values?
a) len()
b) count()
c) number()
d) num()

15. In MYSQL, which type of value should not be enclosed within quotation marks?
a) DATE
b) VARCHAR
c) FLOAT
d) CHAR

16. State True or False:
If table A has 6 rows and 3 columns, and table B has 5 rows and 2 columns, the Cartesian product of A and B will have 30 rows and 5 columns.
Ans: True

17. Which of the following networking devices is used to regenerate and transmit the weekend signal ahead?
a) Hub
b) Ethernet Card
c) Repeater
d) Modem

18. Which of the following options is the correct protocol used for phone calls over the internet?
a) PPP
b) FTP
c) HTTP
d) VoIP (Voice Over Internet Protocol)

19. Expand ARPANET.
Ans: Advanced Research Projects Agency Network

20. Assertion (A): For a binary file opened using 'rb' mode, the pickle.dump() method will display and error.
Reason (R): The pickle.dump() method is used to read from a binary file.
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 and (R) is false.
d) (A) is false but (R) is true.

21. Assertion (A): We can retrieve records from more than one table in MYSQL.
Reason (R): Foreign key is used to establish a relationship between two tables.
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 and (R) is false
d) (A) is false but (R) is true

SECTION B (7x2=14)

22. What does return statement do in function? Explain with the help of an example.
Ans: The return statement in Python is used to exit a function and return a value to the caller.
Example: def Add(A, B):
return A+B
Result=Add(5,3)
print(Result)
Output: 8

23. Write one example of each of the following Python:
(i) Syntax error
Ans: print("Hello World"
(ii) Implicit type conversion
Ans: a = 10
b = 2.5
c = a + b
print(c)
print(type(c))
Implicitly converts a from int to float before performing the addition

24. Consider the following dictionaries, D and D1:
D={"Suman":40, "Raj":55, "Raman":60)
D1{"Aditi":30, "Amit":55, "Raj":60)
(Answer using built-in Python functions only)
(i) (a) Write a statement to display/return the value corresponding to the key "Raj" in the dictionary D.
Ans: print(D["Raj"])

OR

(b) Write a statement to display the length of the dictionary D1.
Ans: print(len(D1))

(ii) (a) Write a statement to append all the key-value pairs of the dictionary D to the dictionary D1.
Ans: D1.update(D)

OR

(b) Write a statement to delete the items with the given key "Amit" from the dictionary D1.
Ans: del D1["Amit"]

25. What possible output from the given options is expected to be displayed when the following code is executed?
import random
Cards=["Heart","Spade","Club","Diamon"]
for i in range(2):
    print(Cards[random.randint(1,i+2)],end="#')
a) Spade#Diamond#
b) Spade#Heart#
c) Diamond#Club#
d) Heart#Spade#

26. The code given below accepts N as an integer argument and returns the sum of all integers from 1 to N. Observe the following code carefully and rewrite it after removing all Syntax and logical errors. Underline all the corrections made.
def SUM(N)
    for I in range(N):
        S=S+I
    return S
print (Sum(10)
Ans: def SUM(N): # Added colon `:`
    S = 0 # Initialized `S` before loop
    for I in range(1, N + 1): # Changed range to start from 1 to N
        S = S + I # No change in logic here
    return S
print(SUM(10)) # Corrected function name and closed parentheses

27. Nisha is assigned the task of maintaining the staff data of an organisation. She has to store the details of the staff in the SQL table named EMPLOYEES with attribute as EMPNO, NAME, DEPARTMENT, BASICSAL to store Employee's Identification Number, Name, Department and Basic Salary respectively. There can be two or more employees with the same name in the organisation.

(i) (a) Help Nisha to identify the attribute which should be designated as the primary key. Justify your answer.
Ans: The attribute that should be designated as the Primary Key is EMPNO. Each employee in the organization is assigned a unique employee number (i.e. EMPNO). This ensures that no two employees will have the same value for this attribute.

OR

(b) Help Nisha to identify the constraint which should be applied to the attribute NAME such that the employees' Name cannot be left empty or NULL while entering the records but can have duplicate values.
Ans: The constraint that should be applied to the attribute NAME is NOT NULL. It ensures that the NAME field must be filled when entering a new record.
Example: NAME VARCHAR(50) NOT NULL

(ii) (a) Write the SQL command to change the size of the attribute BASICSAL in the table EMPLOYEES to allow the maximum value of 99999.99 to be stored in it.
Ans: ALTER TABLE EMPLOYEES MODIFY COLUMN BASICSAL FLOAT(7,2);

OR

(b) Write the SQL command to delete the table EMPLOYEES.
Ans: DROP TABLE EMPLOYEES;

28. (a) Expand and explain the term URL.
Ans: URL stands for Uniform Resource Locator. It is the web address used to access resources on the internet, such as websites, images, videos, or files.
Example: https://www.learncse.in/p/contact-us.html
Here, https:// is a protocol that tells how to connect.
www.learncse.in is a domain / website or server name.
p/contact-us.html is a path of a specific page.

OR

(b) Expand the term PPP. What is the use of PPP?
Ans: PPP stands for Point-to-Point Protocol. PPP is a data link layer communication protocol used to establish a direct connection between two networking nodes (usually two computers or a computer and a server) over serial links like telephone lines, fiber optics, or cable systems.

SECTION C (3x3=9)

29. Write a Python function that displays all the lines containing the word ' vote' from a text file "Electronics.txt". For example if the file contains:
In an election many people vote to choose the representative.
The candidate getting the maximum share of votes stands elected.
Normally, one person has to vote once.
The process of voting may vary with time and reason.
Then the output should be:
In an election many people vote to choose their representative.
Normally, one person has to vote once.
Ans:
def PrintVote():
F=open("Elections.txt")
Lines=F.readlines()
for Line in Lines:
L=Line.split()
if "vote" in L:
print(Line)
F.close()

OR

Write a Python function that displays all the words starting and ending with a vowel from a text file "Report.txt". The consecutive words should be separated by a space in the output. For example, if the file contains:
Once there was a wise man in a village.
He was an awesome story-teller.
He was able to keep people anchored while listening to him.
Then the output should be:
Once a a awesome able
Ans:
def vowels():
F=open('Report.txt')
Data=F.read()
Words=Data.split()
for Word in Words:
if Word[0] in 'aeiouAEIOU':
if Word[–1] in 'aeiouAEIOU':
print(Word,end=' ')
F.close()

30. A stack, named ClrStack, contains records of some colors. Each record is represented as a tuple containing four elements - ColorName, RED, GREEN, BLUE. ColorName is a string, and RED, GREEN, BLUE are integers. For example, a record in the stack may be ('Yellow', 237, 250, 68)
Write the following user-defined functions in Python to perform the specified operations on ClrStack:

(i) pus_Clr(ClrStack, new_Clr): This function takes the stack ClrStack and a new record new_Clr as arguments and pushes this new record on to the stack.
Ans:
def push_Clr(ClrStack, new_Clr):
ClrStack.append(new_Clr)

(ii) pop_Clr(ClrStack): This function pops the top most record from the stack and returns it. If the stack is already empty, the function should display the message "Underflow".
Ans:
def pop_Clr(ClrStack):
if len(ClrStack) == 0:
print("Underflow")
else:
return(ClrStack.pop())

(iii) isEmpty(ClrStack): This function checks whether the stack is empty. If the stack is empty, the function should return True, otherwise the function should return False.
Ans:
def isEmpty(ClrStack):
if len(ClrStack) == 0:
return True
else:
return False

OR

(b) Write the following user-defined functions in Python:

(i) push_trail (N, myStack): Here N and mystack are lists, and myStack represents a stack. The function should push the last 5 elements from the list N onto the stack myStack. For example, if the list N is [1,2,3,4,5,6,7], then the function push_trail() should push the elements 3,4,5,6,7 onto the stack. Therefore the value of stack will be [3,4,5,6,7].
Assume that N contains at least 5 elements.
Ans:
def push_trail(N,myStack):
for i in range(-5,0,1): # Any other correct loop
myStack.append(N[i])

(ii) pop_one (myStack): The function should pop an element from the stack myStack, and return this element. If the stack is empty, then the function should display the message 'Stack Underflow', and return None.
Ans:
def pop_one(myStack):
if not myStack:
print('Stack Underflow')
else:
return myStack.pop()

(iii) display_all (myStack): The function should display all the elements of the stack myStack, without deleting them. If the stack is empty, the function should display the message 'Empty Stack'.
Ans:
def display_all(myStack):
if not myStack:
print("Empty Stack")
else:
for i in myStack[::–1]:
print(i,end=' ')

31. Predict the output of the following code:
def ExamOn (mystr):
newstr = ""
count = 0
for i in mystr:
if count%2!=0:
newstr = newstr + str(count-1)
else:
newstr = newstr + i.lower()
count += 1
newstr = newstr + mystr[:2]
print("The new string is:", newstr)
ExamOn ("GenX")
Ans: The new string is: g0n2Ge

OR

(b) Write the output on execution of the following Python code:
def Change (X):
for K,V in X.items():
L1.append(K)
L2.append (V)
D=(1:"ONE",2: "TWO", 3: "THREE"}
L1=[]
L2=[]
Change (D)
print (L1)
print (L2)
print (D)
Ans:
Ans: [1, 2, 3]
['ONE', 'TWO', 'THREE']
{1: 'ONE', 2: 'TWO', 3: 'THREE'}

SECTION D (4x4=16)

32. Suman has created a table named WORKER with a set of records to maintain the data of the construction sites, which consists of WID, WNAME, WAGE, HOURS, TYPE, and SITEID. After creating the table, she entered data in it, which is as follows:
WID WNAME WAGE HOURS TYPE SITEID
W01 Ahmed J 1500 200 Unskilled 103
W11 Naveen S 520 100 Skilled 101
W02 Jacob B 780 95 Unskilled 101
W15 Nihal K 560 110 Semiskilled NULL
W10 Anju S 1200 130 Skilled 103
(a) Based on the data given above, answer the following questions:
(i) Write the SQL statement to display the names and wages of those workers whose wages are between 800 and 1500.
Ans: SELECT WNAME, WAGE FROM WORKER WHERE WAGE BETWEEN 800 AND 1500;
(ii) Write the SQL statement to display the record of workers whose SITEID is not known.
Ans: SELECT * FROM WORKER WHERE SITEID IS NULL;
(iii) Write the SQL statement to display WNAME, WAGE and HOURS of all those workers whose TYPE is 'Skilled'.
Ans: SELECT WNAME, WAGE, HOURS FROM WORKER WHERE TYPE="Skilled";
(iv) Write the SQL statement to change the WAGE to 1200 of the workers where the TYPE is "Semiskilled".
Ans: UPDATE WORKER SET WAGE=1200 WHERE TYPE="Semiskilled";

OR

(b) Considering the above given table WORKER, write the output on execution of the following SQL commands:
(i) SELECT WNAME, WAGE HOURS FROM WORKER WHERE SITEID = 103;
WNAME WAGE*HOURS
Ahmed J 300000
Anju S 156000
(ii) SELECT COUNT (DISTINCT TYPE) FROM WORKER;
COUNT (DISTINCT TYPE)
3
(iii) SELECT MAX(WAGE), MIN (WAGE), TYPE FROM WORKER GROUP BY TYPE;
MAX (WAGE) MIN (WAGE) TYPE
1500 780 Unskilled
1200 520 Skilled
560 560 Semiskilled
(iv) SELECT WNAME, SITEID FROM WORKER WHERE TYPE="Unskilled" ORDER BY HOURS;
WNAME SITEID
Jacob B 101
Ahmed J 103

33. A csv file "P_record.csv" contains the records of patients in a hospital. Each record of the file contains the following data:
  • Name of a patient
  • Disease
  • Number of days patient is admitted
  • Amount
For example, a sample record of the file may be:
["Gunjan", "Jaundice", 4,15000]
Write the following Python functions to perform the specified operations on this file:
(i) Write a function read_data() which reads all the data from the file and displays the details of all the 'Cancer' patients.
Ans:
import csv
def read_data():
F=open("P_record.csv","r")
Records=list(csv.reader(F))
for R in Records :
if R[1]=="Cancer":
print(R)
F.close()

(ii) Write a function count_rec() which counts and returns the number of records in the file.
Ans:
def count_rec():
with open("P_record.csv","r") as F:
Records=list(csv.reader(F))
print(len(Records))

34. Assume that you are working in the IT Department of a Creative Art Gallery (CAG), which sells different forms of art creations like Paintings, Sculptures etc. The data of Art Creations and Artists are kept in tables Articles and Artists respectively. Following are few records from these two tables:
Table: Articles
Code A_Code Article DOC Price
PL001 A0001 Painting 2018-10-19 20000
SC028 A0004 Sculpture 2021-01-15 16000
QL005 A0003 Quilling 2024-04-24 3000
Table: Artists
A_Code Name Phone Email DOB
A0001 Roy 595923 r@CrAG.com 1986-10-12
A0002 Ghosh 1122334 ghosh@CrAG.com 1972-02-05
A0003 Gargi 121212 Gargi@CrAG.com 1996-03-22
A0004 Mustafa 33333333 Mf@CrAG.com 2000-01-01
Note: The tables contain many more records than shown here.
DOC is Date of Creation of an Article.

As an employee of CAG, you are required to write the SQL queries for the following:
(i) To display all the records from the Articles table in descending order of price.
Ans: SELECT * FROM Articles ORDER BY PRICE DESC;
(ii) To display the details of Articles which were created in the year 2020.
Ans: SELECT * FROM Articles WHERE DOC LIKE '2020%';
Other Answers:
(i) SELECT * FROM Articles WHERE DOC>='2020-01-01' AND DOC<='2020-12-31';
(ii) SELECT * FROM Articles WHERE DOC BETWEEN '2020-01-01' AND '2020-12-31';
(iii) To display the structure of Artists table.
Ans: DESC Artists;
(iv) (a) To display the name of all artists whose Article is Painting through Equi Join.
Ans: SELECT Name FROM Articles A1, Artists A2 WHERE A1.A_code = A2.A_code AND Article='Painting';

OR

(b) To display the name of all Artists whose Article is 'Painting' through Natural Join.
Ans: SELECT Name FROM Articles NATURAL JOIN Artists WHERE Article = 'Painting';

35. A table, named THEATRE, in CINEMA database, has the following structure:
Field Type
Th_ID char(5)
Name varchar(15)
City varchar(15)
Location varchar(15)
Seats int
Write a function Delete_Theatre (), to input the value of Th_ID from the user and permanently delete the corresponding record from the table.
Assume the following for Python-Database connectivity:
Host: localhost, User: root, Password: Ex2025
Ans:
import pymysql as pm # OR import mysql.connector as pm
def Delete_Theatre():
Mydb=pm.connect(host = 'localhost',
user = 'root', password = 'Ex2025', database = 'CINEMA')
MyCursor = Mydb.cursor()
TID = input("Theatre ID:")
Query = "DELETE FROM Theatre WHERE Th_ID='{}'".format(TID)
MyCursor.execute(Query)
Mydb.commit()
Mydb.close()

SECTION E (2x5=10)

36. A file, PASSENGERS.DAT, stores the records of passengers using the following structure:
[PNR, PName, BRDSTN, DESTN, FARE]
where:
PNR - Passenger Number (string type)
PName - Passenger Name (string type)
BRDSTN - Boarding Station Name (string type)
DESTN - Destination Station Name (string type)
FARE - Fare amount for the journey (float type)
Write user defined functions in Python for the following tasks:
(i) Create() - to input data for passengers and write it in the binary file PASSENGERS.DAT.
Ans:
import pickle
def Create():
F=open("PASSENGERS.DAT", "wb")
PNR=input("PNR No:")
PName=input("Name: ")
BRDSTN=input("Boarding at: ")
DESTN=input("Destination: ")
FARE=float(input("Fare: "))
Rec=[PNR,PName,BRDSTN,DESTN,FARE]
pickle.dump(Rec,F)
F.close()
(ii) SearchDestn (D) - to read contents from the file PASSENGERS.DAT and display the details of those Passengers whose DESTN matches with the value of D.
Ans:
def SearchDestn(D):
try: # To be ignored
F=open("PASSENGERS.DAT", "rb")
Rec=pickle.load(F)
for R in Rec:
if R[3]==D;
print(R)
F.close()
except: # To be ignored
print("File not found!") # To be ignored
(iii) UpdateFare () - to increase the fare of all passengers by 5% and rewrite the updated records into the file PASSENGERS.DAT.
Ans:
def UpdateFare():
try:
FR=open("PASSENGERS.DAT", "rb+")
Rec=pickle.load(FR)
for I in range(len(Rec)):
Rec[I][4]+=(Rec[I][4] * 0.05)
print("Updation Done!")
F.seek(0)
pickle.dump(Rec, FR)
FR.Close()
except:
print("File not found!")

37. Swabhaav' is a big NGO working in the field of Psychological Treatment and Counselling, having its Head Office in Nagpur. It is planning to set up a center in Vijayawada. The Vijayawada Center will have four blocks ADMIN, PSYCHIATRY, PSYCHOLOGY, and ICU. You, as a Network Expert, need to suggest the best network-related solutions for them to resolve the issues/problems mentioned in questions (i) to (v), keeping the following parameters in mind:
class-12-cs-083-previous-year-question-paper-2025-with-solution-q37
Block to Block distance (in metres):
From To Distance
ADMIN PSYCHIATRY 65 m
ADMIN PSYCHIATRY 65 m
ADMIN ICU 65 m
PSYCHIATRY PSYCHIATRY 100 m
PSYCHIATRY ICU 50 m
PSYCHIATRY ICU 50 m
Distance of Nagpur Head Office from Viajayawada Center = 700 km

Number of Computers in each block is as follows:
Block No. of Computers
ADMIN 16
PSYCHIATRY 40
PSYCHIATRY 19
ICU 20

(i) Suggest the most appropriate location of the server inside the Vijayawada Center. Justify your choice.
Ans: PSYCHIATRY Block as it has the maximum number of Computers. OR ADMIN Block as is generally the most secure. OR ADMIN Block as is closest to all the blocks.

(ii) Which hardware device will you suggest to connect all the computers within each block of Vijayawada Center?
Ans: Switch/Hub/Router

(iii) Draw a cable layout to efficiently connect various blocks within the Vijayawada Center.
Ans:
class-12-cs-083-previous-year-question-paper-2025-with-solution-q37-1
(iv) Where should the router be placed to provide internet to all the computers in the Vijayawada Center?
Ans: Router should be placed where the server is placed.

(a) The Manager at Nagpur wants to remotely access the computer in Admin block in Vijayawada. Which protocol will be used for this?
Ans: TELNET

OR

(b) Which type of Network (PAN, LAN, MAN or WAN) will be set up among the computers connected with Vijayawada Center?
Ans: LAN or MAN or WAN (Not PAN)

Download Now - Class 12 CS 083 Previous Year Question Paper (PYQP) 2024-25 with Solution

Download-CBSE-Class-12-IT-802--Board-Question-Paper-with-Solution

Year wise Pre-Board and CBSE Previous Year Question Papers with Solution – Class 12 Computer Science (Code 083)

CBSE Class 12 CS 083 PYQP 2026-27 with Solution

CBSE Class 12 CS 083 PYQP 2025-26 with Solution - Updated Soon

CBSE Class 12 CS 083 PYQP 2024-25 with Solution

CBSE Class 12 CS 083 PYQP 2023-24 with Solution

CBSE Class 12 CS 083 PYQP 2022-23 with Solution

CBSE Class 12 CS 083 PYQP 2021-22 (Term 2) with Solution

CBSE Class 12 CS 083 PYQP 2021-22 (Term 1) with Solution

CBSE Class 12 CS 083 PYQP 2019-20 (Compartment) with Solution

CBSE Class 12 CS 083 PYQP 2019-20 with Solution

CBSE Class 12 CS 083  PYQP 2018-19 with Solution

Post a Comment

Previous Post Next Post