0% found this document useful (0 votes)
46 views

COMP. Sc. SAMPLE PAPER-2_MS

SuperNova-LearnPython is a YouTube channel focused on teaching Python and computer science concepts for students in classes 9 to 12. The document includes a sample paper marking scheme for Computer Science, detailing the structure and types of questions included in the exam. It also provides programming exercises and SQL queries relevant to the curriculum.

Uploaded by

arunmgoodlife
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

COMP. Sc. SAMPLE PAPER-2_MS

SuperNova-LearnPython is a YouTube channel focused on teaching Python and computer science concepts for students in classes 9 to 12. The document includes a sample paper marking scheme for Computer Science, detailing the structure and types of questions included in the exam. It also provides programming exercises and SQL queries relevant to the curriculum.

Uploaded by

arunmgoodlife
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

About Us Website: https://www.learnpython4cbse.

com/ Feedback 8076665624

Learnpython4cbse Youtube Channel: Online Classes are Available for


Inspiring Success SuperNova-learnpython Clases 9 to 12- Comp. Sc., IP, AI & IT
PYTHON ONLINE CLASSES COMPUTER SC. INFORMATICS PRAC. SAMPLE PAPERS PYTHON MCQs

SAMPLE PAPER –2 MARKING SCHEME


SUBJECT: COMPUTER SCIENCE
SuperNova-LearnPython, a YouTube channel dedicated to helping students to learn Python
and computer science concepts.
The channel covers various topics related to computer science, including Python
programming, data file handling, computer networking, SQL and many more.
If you’re looking for video descriptions, notes, assignments, and previous years’ question
papers related to Python and computer science for class 11 and 12, I recommend checking
out the SuperNova-LearnPython channel on YouTube.

You can find the channel here1.


Happy learning! .
Please like, Subscribe and share the Channel

BY: AMJAD KHAN Page 1 of 11


Website: https://www.learnpython4cbse.com/ YouTube: https://www.youtube.com/@learnpython4cbse
About Us Website: https://www.learnpython4cbse.com/ Feedback 8076665624

Learnpython4cbse Youtube Channel: Online Classes are Available for


Inspiring Success SuperNova-learnpython Clases 9 to 12- Comp. Sc., IP, AI & IT
PYTHON ONLINE CLASSES COMPUTER SC. INFORMATICS PRAC. SAMPLE PAPERS PYTHON MCQs

SAMPLE PAPER – MARKING SCHEME


Code: Learnpython4cbse-2/5(25CBSE02)

COMPUTER SCIENCE 12TH (CODE 083)

General Instructions:

Time: 3 Hrs. Max. Marks: 70


1. This question paper contains 37 questions.
2. All questions are compulsory. However, internal choices have been provided in some questions.
Attempt only one of the choices in such questions
3. The paper is divided into 5 Sections- A, B, C, D and E.
4. Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
5. Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
6. Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
7. Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
8. Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
9. All programming questions are to be answered using Python Language only.
10. In case of MCQ, text of the correct answer should also be written.

SECTION A [21x1= 21]


1 True 1

2 (a) ['xy','yz'] 1

3 (a) False 1

4 (c) [9, 5, 6, 7, 8] 1

5 t 1

6 [3, 4] 1

7 012 1

8 (b) Removes the first occurrence of a specified value from the list 1

9 (c) Calc (Y=25) 1

10 pickle 1

11 True 1

BY: AMJAD KHAN Page 2 of 11


Website: https://www.learnpython4cbse.com/ YouTube: https://www.youtube.com/@learnpython4cbse
About Us Website: https://www.learnpython4cbse.com/ Feedback 8076665624

Learnpython4cbse Youtube Channel: Online Classes are Available for


Inspiring Success SuperNova-learnpython Clases 9 to 12- Comp. Sc., IP, AI & IT
PYTHON ONLINE CLASSES COMPUTER SC. INFORMATICS PRAC. SAMPLE PAPERS PYTHON MCQs

12 (d) Error 1

13 DROP TABLE 1

14 (b) COUNT 1

15 (a) SQL statements can not be typed in lowercase or uppercase letter. SQL statements are case 1
sensitive.
16 (b) Display records in increasing order of roll number 1

17 (c) Web hosting 1


Or
(b) T2[::-l]
18 (c)HTTP 1

19 Circuit switching 1

20 (a) Both A and R are true and R is the correct explanation for A. 1

21 (c) A is true and R is false. 1

SECTION B [7x2= 14 Marks]

22 def reverseWordSentence(Sentence): 2
words = Sentence.spi1t( "")

newWords = [word[::-l] for word In words]


newSentence = "".join(newWords)

return newSentence

Sentence = "Board exams are coming"


pri nt(reverseWordSentence(Sentence))

23 (i) hex() (ii) range() 2

24 (I) (A) T1.count(10) 2


OR
(B) T1.index(25)

(II) (A)T3 = T1 + T2
OR
(B) T2[::-l]

BY: AMJAD KHAN Page 3 of 11


Website: https://www.learnpython4cbse.com/ YouTube: https://www.youtube.com/@learnpython4cbse
About Us Website: https://www.learnpython4cbse.com/ Feedback 8076665624

Learnpython4cbse Youtube Channel: Online Classes are Available for


Inspiring Success SuperNova-learnpython Clases 9 to 12- Comp. Sc., IP, AI & IT
PYTHON ONLINE CLASSES COMPUTER SC. INFORMATICS PRAC. SAMPLE PAPERS PYTHON MCQs

25 Possible Outputs: (A) S-u-c- (B) S-u-c-c- (C) S-u-c-c-e- 2


Minimum possible value of b: 2
Maximum possible value of b: 5
26 Constraints are check or conditions given on field of a table to restrict entry of invalid data 2
example Unique, NOT NULL.
The foreign key constant can be used to create a link between two tables by assigning one of
the column as foreign key in a table.
27 (I) (A) The keyword used to define a view that combines data from multiple tables is 2
CREATE VIEW
OR
(B) The clause used to filter records based on specific conditions is WHERE.

(II) (A) ALTER TABLE Employees


ADD Email VARCHAR(255);
OR

(B) ALTER TABLE Departments


RENAME COLUMN OldName TO NewName;

28 (i) Wi-Fi is a wireless communication technology that allows devices to connect to the internet 2
and exchange data without the need for physical cables. It uses radio waves to transmit
information between devices, enabling wireless internet access and network connectivity for
various devices like smartphones, laptops, and smart home devices.
(ii) In guided transmission media, cables (or wires) are used for communicating data while in
unguided transmission, in place of cables, signals travel through air.
OR
(i)Following are the three main types of computer networks, based upon the geographical
area as follows:
(a) Local Area Network (LAN)
(b) Metropolitan Area Network (MAN)
(c) Wide Area Network (WAN)
(ii) A switch is a networking device, which is used to connect different LAN segments of a
network. A switch also supports packet filtering and forwarding between LAN segments.

SECTION C [3x3= 9 Marks]

BY: AMJAD KHAN Page 4 of 11


Website: https://www.learnpython4cbse.com/ YouTube: https://www.youtube.com/@learnpython4cbse
About Us Website: https://www.learnpython4cbse.com/ Feedback 8076665624

Learnpython4cbse Youtube Channel: Online Classes are Available for


Inspiring Success SuperNova-learnpython Clases 9 to 12- Comp. Sc., IP, AI & IT
PYTHON ONLINE CLASSES COMPUTER SC. INFORMATICS PRAC. SAMPLE PAPERS PYTHON MCQs

29 (A) 3
def write_urgent_lines():
try:
with open('Messages.txt', 'r') as input_file:
with open('UrgentLines.txt', 'w') as output_file:
for line in input_file:
if 'urgent' in line.lower():
output_file.write(line)
print("Urgent lines have been written to 'UrgentLines.txt'.")
except FileNotFoundError:
print("The file 'Messages.txt' was not found.")
OR
(B)
def count_lines_in_file():
try:
with open('Paragraph.txt', 'r') as file:
lines = file.readlines()
print(f"Number of lines in 'Paragraph.txt': {len(lines)}")
except FileNotFoundError:
print("The file 'Paragraph.txt' was not found.")

30 def push(stack, item): 3


stack.append(item)

def pop(stack):
if len(stack) == 0:
return "Stack is empty"
return stack.pop()

def reverse_string(input_string):
stack = []
# Push all characters of the string into the stack
for char in input_string:
push(stack, char)

reversed_str = ""
# Pop characters from the stack to reverse the string
while len(stack) > 0:
reversed_str += pop(stack)

return reversed_str

# Example usage
input_string = "Hello"
print("Reversed string:", reverse_string(input_string))
OR

BY: AMJAD KHAN Page 5 of 11


Website: https://www.learnpython4cbse.com/ YouTube: https://www.youtube.com/@learnpython4cbse
About Us Website: https://www.learnpython4cbse.com/ Feedback 8076665624

Learnpython4cbse Youtube Channel: Online Classes are Available for


Inspiring Success SuperNova-learnpython Clases 9 to 12- Comp. Sc., IP, AI & IT
PYTHON ONLINE CLASSES COMPUTER SC. INFORMATICS PRAC. SAMPLE PAPERS PYTHON MCQs

(A)
R={"0M":76, "JAI":45, "B0B":89, "AU": 65 , "ANU": 90, "TOM" :82}
def PUSH(S,N):
S.append(N)
def POP(S):
if S!=[]:
return S.popO
else:
return None
ST=[ ]
for k in R:
if R[k]>=75:
PUSH(ST,k)
while True:
if ST!=[]:
print(POP(ST),end="")
else:
break

31 (i) To list the BookTitle of FND type. 3

SELECT BookTitle FROM LIBRARY WHERE Type = 'FND';

(ii) To display a report listing BookTitle, Type and Price in descending order of price.

SELECT BookTitle, Type, Price FROM LIBRARY ORDER BY Price DESC;

(iii) To count the number of BookTitle, Who have FND type.

SELECT COUNT(BookTitle) FROM LIBRARY WHERE Type = 'FND';


OR

(B) To insert a new row in the table LIBRARY.

INSERT INTO LIBRARY (No, BookTitle, Type, Publication, Quantity, Price)


VALUES (7, 'Windows 8 Basics', 'FND', 'McGraw', 7, 150);

BY: AMJAD KHAN Page 6 of 11


Website: https://www.learnpython4cbse.com/ YouTube: https://www.youtube.com/@learnpython4cbse
About Us Website: https://www.learnpython4cbse.com/ Feedback 8076665624

Learnpython4cbse Youtube Channel: Online Classes are Available for


Inspiring Success SuperNova-learnpython Clases 9 to 12- Comp. Sc., IP, AI & IT
PYTHON ONLINE CLASSES COMPUTER SC. INFORMATICS PRAC. SAMPLE PAPERS PYTHON MCQs

(ii) To display the average of those Books whose type is "FND".

SELECT AVG(Price) FROM LIBRARY WHERE Type = 'FND';

(iii) To count the number of books based on type.

SELECT Type, COUNT(*) FROM LIBRARY GROUP BY Type;


SECTION D [4x4= 16 Marks]

32 (A) 4
(I) select Product, sum(Quantity) from orders group by product having sum(Quantity)>=5;
(II) select * from orders order by Price desc;
(III) select distinct C_Name from orders;
(IV) select sum(price) as total_price from orders where Quantity IS NULL;
OR
B) (I)
C_Name | Total_Quantity
Jitendra | 1
Mustafa | 2
Dhwani | 1
(II)
O_Id | C_Name | Product | Quantity | Price
1002 | Mustafa | Smartphone | 2 | 10000
1003 | Dhwani | Headphone | 1 | 1500
(III)
O_Id | C_Name | Product | Quantity | Price
1001 | Jitendra | Laptop | 1 | 12000
1002 | Mustafa | Smartphone | 2 | 10000
1003 | Dhwani | Headphone | 1 | 1500
(IV)
MAX(Price)
12000
33 (I) Write a function to read all the data from the file and display all records, where the total 4
number of residents is less than 2000000:

BY: AMJAD KHAN Page 7 of 11


Website: https://www.learnpython4cbse.com/ YouTube: https://www.youtube.com/@learnpython4cbse
About Us Website: https://www.learnpython4cbse.com/ Feedback 8076665624

Learnpython4cbse Youtube Channel: Online Classes are Available for


Inspiring Success SuperNova-learnpython Clases 9 to 12- Comp. Sc., IP, AI & IT
PYTHON ONLINE CLASSES COMPUTER SC. INFORMATICS PRAC. SAMPLE PAPERS PYTHON MCQs

import csv
def display_small_cities():
with open('HealthSurvey.csv', 'r') as file:
reader = csv.reader(file)
# Skip the header if present
next(reader)
for row in reader:
city = row[0]
residents = int(row[1])
if residents < 2000000:
print(row)

# Example Usage
display_small_cities()

(II) Write a function to count the number of records in the file:

import csv

def count_records():

with open('HealthSurvey.csv', 'r') as file:

reader = csv.reader(file)

# Skip the header if present

next(reader)

# Convert the reader object to a list and count the number of rows

records = list(reader)

count = len(records)

print(f"Number of records: {count}")

BY: AMJAD KHAN Page 8 of 11


Website: https://www.learnpython4cbse.com/ YouTube: https://www.youtube.com/@learnpython4cbse
About Us Website: https://www.learnpython4cbse.com/ Feedback 8076665624

Learnpython4cbse Youtube Channel: Online Classes are Available for


Inspiring Success SuperNova-learnpython Clases 9 to 12- Comp. Sc., IP, AI & IT
PYTHON ONLINE CLASSES COMPUTER SC. INFORMATICS PRAC. SAMPLE PAPERS PYTHON MCQs

# Example Usage

count_records()

34 (a) SELECT NAME FROM STUDENTS WHERE 4


ADDRESS IS NULL;

(b) SELECT COUNT(PHONE) FROM STUDENTS;


(c) SELECT GAME FROM SPORTS WHERE
COACHNAME LIKE "%RAVI";

(d) (A) SELECT * FROM SPORTS;


OR

(B) ALTER TABLE SPORTS

ADD TOURNAMENT VARCHAR(20);

35 def AddAndDelete(): 4
import mysql.connector as mycon
mydb=mycon.connect(host="localhost",user="root",passwd=" Pencil ", database=" ITEMDB
")
mycur=mydb.cursor()
no=int(input("Enter Student Admission Number: "))
nm=input("Enter Student Name: ")
pr=float(input("Enter percentage: "))
cls=int(input("Enter class: "))
query="INSERT INTO student VALUES ({},'{}',{},{});"
query=query.format(no,nm,pr,cls)
mycur.execute(query)
mydb.commit()
try:
mycur.execute("Delete from student where ItemName=„Pencil‟ ;")
mycur.commit()
except:
mydb.close()

BY: AMJAD KHAN Page 9 of 11


Website: https://www.learnpython4cbse.com/ YouTube: https://www.youtube.com/@learnpython4cbse
About Us Website: https://www.learnpython4cbse.com/ Feedback 8076665624

Learnpython4cbse Youtube Channel: Online Classes are Available for


Inspiring Success SuperNova-learnpython Clases 9 to 12- Comp. Sc., IP, AI & IT
PYTHON ONLINE CLASSES COMPUTER SC. INFORMATICS PRAC. SAMPLE PAPERS PYTHON MCQs

SECTION E [2x5= 10 Marks]

36 (a) tell() method tells you the current position of cursor within the file. 5
Syntax: file_object.tell()
(b) import pickle
def AddRegistration() :

f=open("Registration.dat","ab")
ans='y'
rno=" "
sname=" " .
class=" "
Nos=0
while ans=='y':
rno=input("Enter registration no..")
sname=input("Enter student name ")
class=input("Enter class")
Nos=int(Inputt“Enter number of subjects :”))
reglst=[rno.sname,class,Nos]
pickle.dump(reglst,f)
ans=input("Continue(y/n)")
f.close()
def CountRegistrationst):
f=open("Registration.dat","rb")
count=0
try:
while True: -
phonelst=p1ckle.load(f)
count+=1

prlnt(“Number of registrations “,count)


except EOFError:
break
f .close()
AddRegistration()
CountRegistrations()

BY: AMJAD KHAN Page 10 of 11


Website: https://www.learnpython4cbse.com/ YouTube: https://www.youtube.com/@learnpython4cbse
About Us Website: https://www.learnpython4cbse.com/ Feedback 8076665624

Learnpython4cbse Youtube Channel: Online Classes are Available for


Inspiring Success SuperNova-learnpython Clases 9 to 12- Comp. Sc., IP, AI & IT
PYTHON ONLINE CLASSES COMPUTER SC. INFORMATICS PRAC. SAMPLE PAPERS PYTHON MCQs

37 (i) B_TOWN can house the server as it has the maximum no. of computers. 5
(ii) Optical fibre cable is the best for this star topology.

(iii) Switch
(iv) VoIP
(v) MAN (Metropolitan Area Network) will be formed as network would span within a city.

OR
a) Video Conferencing

BY: AMJAD KHAN Page 11 of 11


Website: https://www.learnpython4cbse.com/ YouTube: https://www.youtube.com/@learnpython4cbse

You might also like