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

Cblecspu 03

This document contains a sample paper for the Computer Science Class 12 exam. It has 5 sections with a total of 35 questions. Section A contains 18 one-mark questions, Section B contains 7 two-mark questions, Section C contains 5 three-mark questions, Section D contains 2 four-mark questions, and Section E contains 3 five-mark questions. All programming questions must be answered using Python. The paper tests knowledge of topics like SQL, Python, networking, databases, and more.

Uploaded by

Neha Makhija
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)
145 views

Cblecspu 03

This document contains a sample paper for the Computer Science Class 12 exam. It has 5 sections with a total of 35 questions. Section A contains 18 one-mark questions, Section B contains 7 two-mark questions, Section C contains 5 three-mark questions, Section D contains 2 four-mark questions, and Section E contains 3 five-mark questions. All programming questions must be answered using Python. The paper tests knowledge of topics like SQL, Python, networking, databases, and more.

Uploaded by

Neha Makhija
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/ 10

Page 1 NODIA Sample Paper 3 Computer Science Class 12

Sample Paper 3
Computer Science (083)
CLASS XII 2023-24
Time: 3 Hours Max. Marks: 70
General Instructions:
1. Please check this question paper contains 35 questions.
2. The paper is divided into 4 Sections- A, B, C, D and E.
3. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark
4. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
5. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
6. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
7. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
8. All programming questions are to be answered using Python Language only.

Section A

1. What is default value of host?


(a) host (b) localhost
(c) globalhost (d) None of these

2. Which of the following SQL commands displays the structure of a table?


(a) ALTER (b) STRUCTURE
(c) DESCRIBE (d) SHOW DATA

3. State True or False


“Lists and dictionaries are mutable.”

4. Which of the following is the correct output for the execution of the following Python statement?
print(5+3**2/2)
(a) 32 (b) 8.0
(c) 9.5 (d) 32.0

5. Which path does not start with a leading forward slash ?


(a) Relative (b) Absolute
(c) Both (a) and (b) (d) None of these

6. _____command adds a primary key to a table after it has been already created.
(a) MODIFY (b) ADD PRIMARY
(c) ALTER (d) ADD KEY

7. The clause to get the unique values from a field of a table is


(a) MAX (b) UNIQUE
(c) DISTINCT (d) None of these
Click the Following Button to See the Free MS/Solutions
Page 2 NODIA Sample Paper 3 Computer Science Class 12

8. Observe the following tuples and choose the correct option


t1=(4, 7, 8, 9)
t2=(0, 4, 3)
>>>t=t1+t2
>>>print(t)
(a) (4, 7, 8, 9, 0, 4, 3) (b) (4, 7, 8, 9, 4, 7, 8, 9)
(b) (4, 7, 8, 9) (d) None of these

9. ______is an attribute that makes a link between two tables to fetch corresponding data.
(a) Primary key (b) Secondary key
(c) Foreign key (d) Composite key

10. Assume that the position of the file pointer is at the beginning of 3rd line in a text file. Which of the following option
can be used to read all the remaining lines?
(a) myfile.read(n-3) (b) myfile.read(n)
(c) myfile.readline( ) (d) myfile.readlines( )

11. ______is a protocol used for uploading and downloading of files in a network.
(a) SMTP (b) FTP
(c) PPP (d) VoIP

12. sub = “PYTHON”


for i in sub:
print (i, ‘ ’, end = “ ”)
P
Y
T
(a) PYTHON (b) H
O
N

(c) None (d) P, Y, T, H, O, N

13. In complex number a + ib, b represents as


(a) real part (b) imaginary part
(c) special part (d) None of these

14. Given an object obj1= (10, 20, 30, 40, 50, 60, 70, 80, 90). What will be the output of print(obj1[3:7:2])?
(a) (40,50,60,70,80) (b) (40,50,60,70)
(c) (40,50,60) (d) (40,60)

15. Which of the following function returns the total number of values?
(a) MAX (b) MIN
(c) COUNT (d) SUM

Click the Following Button to See the Free MS/Solutions


Page 3 NODIA Sample Paper 3 Computer Science Class 12

16. Which of the following is the correct output for the following execution ?
print(print(“Biscope”))
(a) Biscope (b) None
(c) Biscope (d) Error
None

Directions : (Q. Nos. 17 and 18) are Assertion and Reason based questions.

17. Assertion (A) A Python function that accepts parameters can be called without any parameters. Reason (R) Functions
can carry default values that are used, whenever values are not received from calling function.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true but R is not the correct explanation of A.
(c) A is true but R is false.
(d) A is false but R is true.

18. Assertion (A) A CSV file is by default delimited by comma(,), but the delimiter character can be changed.
Reason (R) The writerow() function for CSV files has a “delimiter” parameter that can be used to specify the
delimiter to be used for a CSV file.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true but R is not the correct explanation of A.
(c) A is true but R is false.
(d) A is false but R is true.

Section - B

19. What will be the output for the following Python statement?
L = [10, 20, 30, 40, 50]
L = L + 5
print(L)

20. Write any two disadvantages of star topology.


 o
Why is a switch called an intelligent hub?

21. (a) What will be the output of the following Python code?
L =[10, 20]
L1=[30, 40]
L2=[50, 60]
L. append (L1)
L.extend(L2)
print(L)
(b) Find the output
>>> l1 = [1,2,3,4]
>>> l2 = [1,2,3,4]
>>> l1 > l2

Click the Following Button to See the Free MS/Solutions


Page 4 NODIA Sample Paper 3 Computer Science Class 12

22. Mention the various advantages of using a DBMS.

23. (a) Write the full forms of the following


(i) WAN (ii) GSM
(b) Write down the expansion of Modem. Also, write its role in a network.

24. Write the output of given code :


x = (1, 2, 3)
y = (3, 4)
t = x + y
print(t)
 o
Observe the following tuple and answer the questions that follow:
t1 = (70, 56, ‘Hello’, 22, 2, ‘Hi’, ‘The’, ‘World’, 3)
(i) t1[2 : 4] (ii) t1[– 6]

25. If R1 is a relation with 8 rows and 5 columns, then what will be the cardinality of R1?
If 5 rows are added more, what will be the Degree of the table now ?
 o
Identify commands/functions for the following actions
(i) To display only records of Trains from the Train table whose starting station is “NDLS”. (Column for starting
station is “Start”, table name is “Train”)
(ii) To get the average of percentage of students (Table name : “Student” , Percentage column : “Perc”).

Section - C
26. (a) Consider the tables CITY and LOCATION given below.
Table : CITY
Field Name Data Type Remarks

CITYCODE CHAR(5) Primary Key

CITYNAME CHAR(30)

SIZE INTEGER

AVGTEMP INTEGER

POPULATIONRATE INTEGER

POPULATION INTEGER

Click the Following Button to See the Free MS/Solutions


Page 5 NODIA Sample Paper 3 Computer Science Class 12

Table: Location
Citycode Lname
C1 East
C2 West
C3 South
C4 North
Write a command to display the Cityname and corresponding Location name (Lname), where the average temperature
is greater than 35 from the tables.
(b) Write outputs for the SQL commands (i) to (iv) based on the table CUSTOMER given below:
TABLE: CUSTOMER
CID CNAME GENDER SID AREA

1001 R SHARMA FEMALE 101 NORTH

1002 M R TIWARY MALE 102 SOUTH


1003 M K KHAN MALE 103 EAST

1004 A K SINGH MALE 102 EAST

1005 S SEN FEMALE 101 WEST

1006 R DUBEY MALE 104 NORTH

1007 M AGARWAL FEMALE 104 NORTH

1008 S DAS FEMALE 103 SOUTH

1009 R K PATIL MALE 102 NORTH

1010 N KRISHNA MURTY MALE 102 SOUTH


(i) SELECT COUNT(*), GENDER FROM CUSTOMER GROUP BY GENDER;
(ii) SELECT CNAME FROM CUSTOMER WHERE CNAME LIKE ‘L%’;
(iii) SELECT DISTINCT AREA FROM CUSTOMER;
(iv) SE.LECT’COUNT(*) FROM CUSTOMER WHERE GENDER=“MALE”;

27. Write a Python program that read the data from file ‘original.dat’ and delete the line(s) having word (passed as an
argument). Then write these data after removing lines into file ‘duplicate.dat’.
 o
Write a program in Python to open a text file “lines.txt” and display all those words whose length is greater than 5.

28. (a) Answer the questions (i) to (iv) on the basis of the following tables SHOPPE and ACCESSORIES.
TABLE: SHOPPE
Id SName Area
S001 ABC Computeronics CP

Click the Following Button to See the Free MS/Solutions


Page 6 NODIA Sample Paper 3 Computer Science Class 12

S002 All Infotech Media GK II


S003 Tech Shoppe CP
S004 Geeks Tecno Soft Nehru Place
S005 Hitech Tech Store Nehru Place

TABLE: ACCESSORIES
No Name Price Id

A01 Mother Board 12000 S01


A02 Hard Disk 5000 S01

A03 Keyboard 500 S02

A04 Mouse 300 S01


A05 Mother Board 13000 S02

A06 Keyboard 400 S03

A07 LCD 6000 S04

T08 LCD 5500 S05

T09 Mouse 350 S05


T10 Hard Disk 4500 S03

(i) To display Name and Price of all the ACCESSORIES in ascending order of their Price.
(ii) To display Id and SName of all SHOPPE located in Nehru Place.
(iii) To display Minimum and Maximum Price of each Name of ACCESSORIES.
(iv) To display Name, Price of all ACCESSORIES and their respective SName, where they are available.
(b) Write a command to add a new column Remarks varchar(30) to the ACCESSORIES table storing remarks about
the product.

29. Write a userdefined function parser(L) that accepts a list as parameter and creates another two lists storing the
numbers from the original list , that are even and numbers that are odd.

30. Consider the following stack of characters, where STACK is allocated N = 8 memory cells.
STACK : A, C, D, F, K,...,...,...
Describe the STACK at the end of the following operations. Here, Pop and Push are algorithms for deleting and
adding an element to the stack.
(i) Pop (STACK, ITEM)
(ii) Pop (STACK, ITEM)
(iii) Push (STACK, L)
(iv) Push (STACK, P)

Click the Following Button to See the Free MS/Solutions


Page 7 NODIA Sample Paper 3 Computer Science Class 12

(v) Pop (STACK, ITEM)


(vi) Push (STACK, R)
(vii) Push (STACK, S)
(viii) Pop (STACK, ITEM)
 o
Consider the following sequence of numbers:
1, 2, 3, 4
These are supposed to be operated through a stack to produce the following sequence of numbers:
2, 1, 4, 3
List the Push and Pop operations to get the required output.

Section D

31. Trine Tech Corporation (TTC) is a professional consultancy company. The company is planning to set up their
new offices in India with its hub at Hyderabad. As a network adviser, you have to understand their requirement and
suggest them the best available solutions. Their queries are mentioned as (i) to (v) below.

Block (From) Block (To) Distance


Human Resource Conference 110
Human Resource Finance 40
Conference Finance 80
Expected number of computers to be in each block
Block Computers
Human Resource 25
Finance 120
Conference 90
(i) Which will be the most appropriate block, where TTC should plan to install their server?
(ii) Draw a block to block cable layout to connect all the buildings in the most appropriate manner for efficient
communication.

Click the Following Button to See the Free MS/Solutions


Page 8 NODIA Sample Paper 3 Computer Science Class 12

(iii) Suggest a suitable topology to connect the computers in each building.


(iv) Which of the following device will be suggested by you to connect each computer in each of the buildings?
(a) Switch/Hub (b) Modem (c) Gateway
(v) Company is planning to connect its offices in Hyderabad which is less than 1 km. Which type of network will
be formed?

32. (a) What will be the output of the following code?


value = 50
def display(N):
global value
value = 25
if N%7==0
value = value + N
else:
value = value — N
print(value. end= “#”)
display(20)
print(value)
(b) Given below is a table Item in database Inventory.
ItemID ItemName Quantity UnitPrice
101 ABC 5 120
102 XYZ 7 70
103 PQR 8 65
104 XYZ 12 55
Riya created this table but forget to add column ManufacturingDate. Can she add this column after creation of table?
If yes, write the code where user’s name and password are system and test respectively.
Note the following to establish the connection between Python and MySQL:
Host : localhost
Username : system
Password : test
Database : Inventory
 o
(a) Find the output of the following code :
Name= “PythoN3@1”
R=“ ”
for x in range(len(Name)):
if Name[x].isupper():
R=R+Name[x].lower()
elif Name[x].islower():
R=R+Name[x].upper()
elif Name[x].isdigit():
R=R+Name[x–1]
else:
R=R+ “#”
print(R)

Click the Following Button to See the Free MS/Solutions


Page 9 NODIA Sample Paper 3 Computer Science Class 12

(b) Consider the following table structure


Table: Faculty
F_ID(P)
Fname
Lname
Hire_date
Salary
Write the Python code to create the above table.
Consider :
host : localhost
UserName : root
Password : system
Database :School

33. What do you mean by file? What do you mean by file handling?
Write a program code in python to perform the following using two functions as follows :
(a) addBook( ) : to write to a csv file “book.csv” file book no, book name and no of pages with separator as tab.
(b) countRecords( ) : To count and display the total number of records in the “book.csv” file
 o
Explain open( ) function with its syntax.
Write python code to perform the following using two user defined functions.
(a) showData() : To display only roll no and student name of the file “student.csv”

RollNo, Name, Marks


1, Nilesh, 65
2, Akshay, 75
(b) showSelect( ) : To display only roll number and marks of the students from the csv file “student.csv”

Section-E

34. Consider the following table STORE and answer the questions:
TABLE: STORE
ItemNo Item Scode Qty Rate LastBuy
2005 Sharpener Classic 23 60 8 31-JUN-09
2003 Balls 22 50 25 01-FEB-10
2002 Gel Pen Premium 21 150 12 24-FEB-10
2006 Gel Pen Classic 21 250 20 11-MAR-09
2001 Eraser Small 22 220 6 19-JAN-09
2004 Eraser Big 22 110 8 02-DEC-09
2009 Ball Pen 0.5 21 180 18 03-NOV-09

Click the Following Button to See the Free MS/Solutions


Page 10 NODIA Sample Paper 3 Computer Science Class 12

(i) What is the degree of the table?


(ii) Write the syntax of the SQL command to change data of the table.
(iii) Write statements to :
(a) Display the number of distinct Scodes.
(b) Display the maximum and minimum quantities.
(Option for part (iii) only)
Write statements to :
(a) Display the structure of the STORE table.
(b) Add a new column Location varchar(50) in the table to store the location details of the items.

35. Given below is a code to open a text file “para.txt” and display the lines that begin with “A”.Some of the codes are
missing . Write codes to fill up the blanks :
myf=open(... ,...) Blank 1 , Blank 2
lines=myf....... . Blank 3
for ln in .... . . : Blank 4
if ln[0]= = “A”:
print(ln)
(i) Write the missing code for Blank 1.
(ii) Write the missing code for Blank 2.
(iii) Write the missing code for Blank 3 and Blank 4.

Click the Following Button to See the Free MS/Solutions

You might also like