0% found this document useful (0 votes)
43 views8 pages

CS_Pre_Board_1_Exam_Class_XII_Session-2022-23

Uploaded by

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

CS_Pre_Board_1_Exam_Class_XII_Session-2022-23

Uploaded by

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

1

DAV Centenary Public School, Haldwani, Uttarakhand


Pre Board 1 (Session: 2022-23)
Class: XII, Subject-Computer Science, Time: 3 Hours, Max. Marks: 70
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A have 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35 against part
c only.
8. All programming questions are to be answered using Python Language only.

SECTION A
1. Is Python case sensitive when dealing with identifiers? 1
(a)Yes (b)No (c)Machine dependent (d)None of these
2. Which of the following is an ordered data type? 1
(a)integer (b)Boolean (c)tuple (d)float
3. Which of the following will delete key: value pair for key = ‘tiger’ in dictionary? 1
(a)del di[‘tiger’] (b)di[‘tiger’].delete() (c)delete di.[‘tiger’])
(d)del(di.[‘tiger’])
4. Consider the given expression: 1
"abc"=="Abc" and not (2==3 or 3==4)
Which of the following will be correct output if the given expression is evaluated?
(a) True (b) False (c) NONE (d) NULL
5. Select the correct output of the code: 1
a = "I enjoy working in Python"
b = a.partition(‘working’)
print(b)
(a)(‘I enjoy’, ‘working’, ‘in Python’) (b)[‘I’, ‘enjoy’, ‘working’, ‘in’, ‘Python’]
(c)(‘I’, ‘enjoy’, ‘in Python’) (d)None of these
6. Which of the following is not a valid mode to open a file? 1
(a)wb+ (b)w (c)wb (d)w+
7. ___________command is used to rename column of table in SQL. 1
(a)insert (b)rename (c)alter (d)changename
8. Which of the following commands do we use to delete all the tuples from a relations (R)? 1
(a)DELETE TABLE R; (b)DROP TABLE R; (c)DELETE FROM R;
(d)DROP FROM R;
9. Which of the following statement(s) would give an error after executing the following code? 1
S="PRE-BOARD EXAM FOR CLASS XII" # Statement 1
print(S) # Statement 2
S="BEST OF LUCH" # Statement 3
S[0]= '$' # Statement 4
S = S + "WELCOME" # Statement 5
2

(a) Statement 3 (b) Statement 4 (c) Statement 5 (d) Statement 4 and 5


10 Which of the following types of table constraints will prevent the entry of duplicate rows? 1
. (a)Unique (b)Distinct (c)Primary Key (d)NULL
11 The correct syntax of tell() is: 1
(a)file_object.tell() (b)tell(file_object) (c)file_object(tell())
(d)None of these
12 Fill in the blank: 1
The _______ statement when combined with Distinct clause, returns records without
repetition.
(a) INSERT (b) DISPLAY (c) SELECT (d) UPDATE
13 Fill in the blanks 1
__________is a protocol used for safe transaction using Internet.
(a)HTTP (b)HTTPs (c)SMTP (d)None of these
14 What is the output of the following code? 1
print(6*3 + 4**2//5 -8)
(a)13 (b)20 (c)12 (d)14
15 Which function is used to display the total number of records from table in a database? 1
(a) sum(*) (b) total(*) (c) count(*) (d) return(*)
16 To establish a connection between Python and SQL database, connect() is used. Which of the 1
following arguments may not necessarily be given while calling connect() ?
(a) host (b) database (c) user (d) password
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as
(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 but R is False
(d) A is false but R is True
17 Assertion (A):- During function call the order and number of arguments in the function 1
definition are called required arguments.
Reasoning (R):- During a function call, the argument list first contains required arguments,
then default arguments.
18 Assertion (A): CSV (Comma Separated Values) is a file format for data storage which is like 1
binary file.
Reason (R): The information is organized with one record on each line and each field is
separated by comma.
SECTION B
19 Rewrite the following code in Python after removing all syntax error(s). Underline each 2
correction done in the code:

20 Differentiate between circuit and packet switching. 2


3

Or
Write difference between HTML and XML.
21 Explain the use of ‘Primary Key’ in a Relational Database Management System. Give 2
example to support your answer.
22 (i) Write full forms of the following: 2
(a)SMTP (b)PPP
(ii)What is the use of DHCP?
23 Predict the output of the Python code given below: 2

24 (i)Find the output of following code fragment: 2


names=['Hasan','Balwant','Sean','Dia']
print(names[-1][-1])
(ii)What will be the output of the following code snippet?
rec={'Name':'Python','Age':20,'Addr':'NJ','Country':'USA'}
id1=id(rec)
del rec
rec={'Name':'Python','Age':20,'Addr':'NJ','Country':'USA'}
id2=id(rec)
print(id1==id2)
25 (i)Categorize the following commands as DDL or DML: CREATE, UPDATE, INSERT, 2
DELETE
(ii)Write full form of DML and DDL.
SECTION C
26 (i) Write the output of the SQL queries (a) to (d) based on the table TRAVEL given below : 2

(
a) SELECT START, END FROM TRAVEL WHERE FARE <= 4000 ;
(b) SELECT T_ID, FARE FROM TRAVEL WHERE T_DATE LIKE '2021-12-%' ;
(c) SELECT T_ID, T_DATE FROM TRAVEL WHERE END = 'CHENNAI' ORDER BY
4

FARE ;
(d) SELECT START, MIN(FARE) FROM TRAVEL GROUP BY START ;
(ii) Observe the following table carefully and write the names of the most appropriate 1
columns, which can be considered as (i) candidate keys

27 Write a method/function Words() in Python to read contents from a text file ZIP.TXT, to 3
count and display the occurrence of those words, which are having more than 4 alphabets.
For example :
If the content of the file is
She started to work there
Right now, we looking forward to get you renowned
The output of the function should be: 7
28 (i)Consider the following DEPT and EMPLOYEE tables. Write SQL queries for (i) to (iii). 2
Table : DEPT +
1

Note : DOJ refers to date of joining and DOB refers to date of Birth of employees.
(a) To display Eno, Name, Gender from the table EMPLOYEE in ascending order of Eno.
(b) To display the Name of all the MALE employees from the table EMPLOYEE.
(c) To display the Eno, Name, Department, Location of those employees from the table
EMPLOYEE who are born between ‘1987-01-01’ and ‘1991-12-01’.
(d) To count and display FEMALE employees who have joined after ‘1986-01-01’.
(ii)Write a SQL command to list all tables in a database.
29 (i)What are the possible outcome(s) executed from the following code? Also specify the 3
maximum and minimum values that can be assigned to variable N.
5

(ii)Write a line of code that writes “Hello World!” to a file opened with file object myfile.
30  Write the definition of a user defined function Push35(N) which accepts a list of 3
integers in a parameter N and pushes all those integers which are divisible by 3 and
divisible by 5 from the list N into a list named Only35.
 Write a program in Python to input 10 integers into a list named NUM.
The program should then use the function Push35() to create the stack of the list Only35.
Thereafter pop each integer from the list Only35 and display the popped value. When the list
is empty, display the message “StackEmpty”.
For example:
If the integers input into the list NUM are:
[10,6,14,18,30,21,45,60, 65,90]
Then the stack Only35 should store
[30, 45, 60, 90]
And the output should be displayed as
30 45 60 90 StackEmpty
31 Xcelencia Edu Services Ltd. is an educational organization. It is planning to set up its India 5
campus at Hyderabad with its head office at Delhi. The Hyderabad campus has 4 main
buildings - ADMIN, SCIENCE, BUSINESS and ARTS. You as a network expert have to
suggest the best network related solutions for their problems raised in (i) to (v), keeping in
mind the distances between the buildings and other given parameters.
6

(a) Suggest the most appropriate location of the server inside the HYDERABAD campus (out
of the 4 buildings), to get the best connectivity for maximum number of computers. Justify
your answer.
(b) Suggest and draw the cable layout to efficiently connect various buildings within the
HYDERABAD campus for connecting the computers.
(c) Which hardware device will you suggest to be used in all buildings to connect all
computers.
(d) Which of the following will you suggest to establish the online face-to-face
communication between the people in the Admin Office of HYDERABAD campus and
DELHI Head Office?
(i) E-mail
(ii) Text Chat
(iii) Video Conferencing
(iv) Cable TV
(e)Which hardware device will you suggest to be procured by the company to be installed to
protect and control the internet uses within the campus?
32 (a)Write the output of the code given below: 2
+
3

(b) The code given below reads the following record from the table named student and
displays only those records who have marks greater than 75:
RollNo – integer
7

Name – string
Clas – integer
Marks – integer
Note the following to establish connectivity between Python and MYSQL:
 Username is root
 Password is tiger
 The table exists in a MYSQL database named school.
Write the following missing statements to complete the code:
Statement 1 – to form the cursor object
Statement 2 – to execute the query that extracts records of those
students whose marks are greater than 75.
Statement 3- to read the complete result of the query (records whose marks are greater than
75) into the object named data, from the table student in the database.

33 Give any one point of difference between a binary file and a csv file. Write a Program in 5
Python that defines and calls the following user defined functions:
(i) add() – To accept and add data of an employee to a CSV file ‘furdata.csv’. Each record
consists of a list with field elements as fid, fname and fprice to store furniture id, furniture
name and furniture price respectively.
(ii) search()- To display the records of the furniture whose price is more than 10000.
SECTION E
34 (i)Rashmi has forgotten the names of the databases, tables and the structure of the tables that 4
she had created in Relational Database Management System (RDBMS) on her computer.
(a) Write the SQL statement to display the names of all the databases present in RDBMS
application on her computer.
(b) Write the statement which she should execute to open the database named "STOCK".
(c) Write the statement which she should execute to display the structure of the table
"ITEMS" existing in the above opened database "STOCK".
(ii)A SQL table BOOKS contains the following column names :
BOOKNO, BOOKNAME, QUANTITY, PRICE, AUTHOR Write the SQL statement to add a
new column REVIEW to store the reviews of the book.
35 Rohit, a student of class 12th, is learning CSV File Module 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.
8

(i) Identify the suitable code for blank space in line marked as Statement-1. Identify the 1
missing code for blank space in line marked as Statement-2?
(ii)Choose the function name (with argument) that should be used in the blank space of line 1
marked as Statement-3
(iii) Identify the suitable code for blank space in line marked as Statement-4. 1
(iv)Write the function name that should be used in the blank space of line marked as 1
Statement-5 to create the desired CSV File?

You might also like