0% found this document useful (0 votes)
71 views10 pages

Ahmadabad QP

The document provides instructions for a pre-board examination in Computer Science. It contains two compulsory parts - Part A and Part B. Part A has two sections - short answer questions and case study questions. Part B contains three sections of short answer, long answer and very long answer questions worth 2, 3 and 5 marks respectively. All programming questions must be answered in Python. The document provides sample questions and instructions for candidates regarding the exam format and conduct.
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)
71 views10 pages

Ahmadabad QP

The document provides instructions for a pre-board examination in Computer Science. It contains two compulsory parts - Part A and Part B. Part A has two sections - short answer questions and case study questions. Part B contains three sections of short answer, long answer and very long answer questions worth 2, 3 and 5 marks respectively. All programming questions must be answered in Python. The document provides sample questions and instructions for candidates regarding the exam format and conduct.
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

KENDRIYA VIDYALAYA SANGATHAN, AHMEDABAD REGION

FIRST PRE-BOARD EXAMINATION, 2020


SUBJECT : COMPUTER SCIENCE (NEW) – 083 M.M : 70
CLASS : XII TIME : 3 HOURS

General Instructions:
1. This question paper contains two parts A and B. Each part is compulsory.
2. Both Part A and Part B have choices.
3. Part – A has 2 sections:
a. Section – I is short answer questions, to be answered in one word or one line.
b. Section – II has two case studies questions. Each case study has 4 case-based sub-parts. An examinee
is to attempt any 4 out of the 5 subparts.
4. Part – B is Descriptive Paper.
5. Part – B has three sections
a. Section – I is short answer questions of 2 marks each in which two questions have internal options.
b. Section – II is long answer questions of 3 marks each in which two questions have internal options.
c. Section – III is very long answer questions of 5 marks each in which one question has internal option.
6. All programming questions are to be answered using Python Language only.

Questi PART – A Marks


on No. Allocated
Section – I
Select the most appropriate option out of the options given for each
question. Attempt any 15 questions from question no. 1 to 21.
1 Which of the following is not a valid identifier name in Python? Justify reason 1
for it not being a valid name.
a) 5Total b) _Radius c) pie d)While
2 Find the output - 1
>>>A = [17, 24, 15, 30]
>>>A.insert( 2, 33)
>>>print ( A [-4])
3 Name the Python Library modules which need to be imported to invoke the 1
following functions:
(i) ceil() (ii) randrange()
4 Which of the following are valid operator in Python: 1
(i) */ (ii) is (iii) ^ (iv) like

Page 1 of 10
5 Which of the following statements will create a tuple ? 1
(a) Tp1 = (“a”, “b”)
(b) Tp1= (3) * 3
(c) Tp1[2] = (“a”, “b”)
(d) None of these
6 What will be the result of the following code? 1
>>>d1 = {“abc” : 5, “def” : 6, “ghi” : 7}
>>>print (d1[0])
(a) abc (b) 5 (c) {“abc”:5} (d) Error
7 Find the output of the following: 1
>>>S = 1, (2,3,4), 5, (6,7)
>>> len(S)
8 Which of the following are Keywords in Python ? 1
(i) break (ii) check (iii) range (iv) while
9 __________ is a specific condition in a network when more data packets are 1
coming to network device than they can handle and process at a time.
10 Ravi received a mail from IRS department on clicking “Click –Here”, he was 1
taken to a site designed to imitate an official looking website, such as
IRS.gov. He uploaded some important information on it.
Identify and explain the cybercrime being discussed in the above scenario.
11 Which command is used to change the number of columns in a table? 1
12 Which keyword is used to select rows containing column that match a 1
wildcard pattern?
13 The name of the current working directory can be determined using ______ 1
method.
14 Differentiate between Degree and Cardinality. 1
15 Give one example of each – Guided media and Unguided media 1
16 Which of the following statement create a dictionary? 1
a) d = { }
b) d = {“john”:40, “peter”:45}
c) d = (40 : “john”, 45 : “peter”}
d) d = All of the mentioned above

Page 2 of 10
17 Find the output of the following: 1
>>>Name = “Python Examination”
>>>print (Name [ : 8 : -1])
18 All aggregate functions except ___________ ignore null values in their input 1
collection.
a) Count (attribute) b) Count (*) c) Avg () d) Sum ()
19 Write the expand form of Wi-Max. 1
20 Group functions can be applied to any numeric values, some text types and 1
DATE values. (True/False)
21 _______________ is a network device that connects dissimilar networks. 1

Section – II
Both the Case study based questions are compulsory. Attempt any 4
sub parts from each question. Each question carries 1 mark.
22 A department is considering to maintain their worker data using SQL to store 1*4=4
the data. As a database administer, Karan has decided that :

Name of the database - Department


Name of the table - WORKER

The attributes of WORKER are as follows:


WORKER_ID - character of size 3
FIRST_NAME – character of size 10
LAST_NAME– character of size 10
SALARY - numeric
JOINING_DATE – Date
DEPARTMENT – character of size 10

WORKER_I FIRST_NA LAST_NAM SALARY JOINING_D DEPARTM


D ME E ATE ENT
001 Monika Arora 100000 2014-02-20 HR
002 Niharika Diwan 80000 2014-06-11 Admin
003 Vishal Singhal 300000 2014-02-20 HR
004 Amitabh Singh 500000 2014-02-20 Admin
005 Vivek Bhati 500000 2014-06-11 Admin
006 Vipul Diwan 200000 2014-06-11 Account
007 Satish Kumar 75000 2014-02-20 Account
008 Monika Chauhan 80000 2014-04-11 Admin
a) Write a query to create the given table WORKER. 1
b) Identify the attribute best suitable to be declared as a primary key. 1
c) Karan wants to increase the size of the FIRST_NAME column from 1
10 to 20 characters. Write an appropriate query to change the size.

Page 3 of 10
d) Karan wants to remove all the data from table WORKER from the 1
database Department. Which command will he use from the
following:
i) DELETE FROM WORKER;
ii) DROP TABLE WORKER;
iii) DROP DATABASE Department;
iv) DELETE * FROM WORKER;
e) Write a query to display the Structure of the table WORKER, i.e. name
of the attribute and their respective data types.
23 Ashok Kumar of class 12 is writing a program to create a CSV file 1*4=4
“empdata.csv” with empid, name and mobile no and search empid and
display the record. He has written the following code. As a programmer, help
him to successfully execute the given task.
import _____ #Line1
fields=['empid','name','mobile_no']
rows=[['101','Rohit','8982345659'],['102','Shaurya','8974564589'],
['103','Deep','8753695421'],['104','Prerna','9889984567'],
['105','Lakshya','7698459876']]
filename="empdata.csv"
with open(filename,'w',newline='') as f:
csv_w=csv.writer(f,delimiter=',')
csv_w.___________ #Line2
csv_w.___________ #Line3

with open(filename,'r') as f:
csv_r=______________(f,delimiter=',') #Line4
ans='y'
while ans=='y':
found=False
emplid=(input("Enter employee id to search="))
for row in csv_r:
if len(row)!=0:
if _____==emplid: #Line5
print("Name : ",row[1])
print("Mobile No : ",row[2])
found=True
Page 4 of 10
break
if not found:
print("Employee id not found")
ans=input("Do you want to search more? (y)")

(a) Name the module he should import in Line 1. 1


(b) Write a code to write the fields (column heading) once from fields list 1
in Line2.
(c) Write a code to write the rows all at once from rows list in Line3. 1
(d) Fill in the blank in Line4 to read the data from a csv file. 1
(e) Fill in the blank to match the employee id entered by the user with the 1
empid of record from a file in Line5.
PART – B
Section – I
24 Evaluate the following expressions: 2
a) 12*(3%4)//2+6
b) not 12 > 6 and 7 < 17 or not 12 < 4
25 Define and explain all parts of a URL of a website. i.e. 2
https://www.google.co.in. It has various parts.
OR
Define cookies and hacking.
26 Expand the following terms: 2
a) IPR b) SIM c) IMAP d)HTTP
27 What is the difference between a Local Scope and Global Scope ? Also, give 2
a suitable Python code to illustrate both.
OR
Define different types of formal arguments in Python, with example.
28 Observe the following Python code very carefully and rewrite it after 2
removing all syntactical errors with each correction underlined.
DEF result_even( ):
x = input(“Enter a number”)
if (x % 2 = 0) :
print (“You entered an even number”)

Page 5 of 10
else:
print(“Number is odd”)
even ( )
29 What possible output(s) are expected to be displayed on screen at the time 2
of execution of the program from the following code? Also specify the
minimum values that can be assigned to each of the variables BEGIN and
LAST.
import random
VALUES = [10, 20, 30, 40, 50, 60, 70, 80]
BEGIN = random.randint (1, 3)
LAST = random.randint(2, 4)
for I in range (BEGIN, LAST+1):
print (VALUES[I], end = "-")
(i) 30-40-50- (ii) 10-20-30-40-
(iii) 30-40-50-60- (iv) 30-40-50-60-70-
30 What is the difference between Primary Key and Foreign Key? Explain with 2
Example.
31 What is the use of commit and rollback command in MySql. 2
32 Differentiate between WHERE and HAVING clause. 2
33 Find and write the output of the following Python code: 2
def makenew(mystr):
newstr = " "
count = 0
for i in mystr:
if count%2 !=0:
newstr = newstr+str(count)
else:
if i.islower():
newstr = newstr+i.upper()
else:
newstr = newstr+i
count +=1
newstr = newstr+mystr[:1]

Page 6 of 10
print("The new string is :", newstr)
makenew("sTUdeNT")
SECTION - II
34 Write a function bubble_sort (Ar, n) in python, Which accepts a list Ar of 3
numbers and n is a numeric value by which all elements of the list are sorted
by Bubble sort Method.
35 Write a function in python to count the number lines in a text file ‘Country.txt’ 3
which is starting with an alphabet ‘W’ or ‘H’. If the file contents are as follows:
Whose woods these are I think I know.
His house is in the village though;
He will not see me stopping here
To watch his woods fill up with snow.
The output of the function should be:
W or w : 1
H or h : 2
OR
Write a user defined function to display the total number of words present in
the file.
A text file “Quotes.Txt” has the following data written in it:
Living a life you can be proud of doing your best Spending your time with
people and activities that are important to you Standing up for things that are
right even when it’s hard Becoming the best version of you.
The countwords() function should display the output as:
Total number of words : 40
36 Write the output of the SQL queries (i) to (iii) based on the table: Employee 3
Ecode Name Dept DOB Gender Designation Salary
101 Sunita Sales 06-06-1995 F Manager 25000
102 Neeru Office 05-07-1993 F Clerk 12000
103 Raju Purchase 05-06-1994 M Manager 26000
104 Neha Sales 08-08-1995 F Accountant 18000
105 Nishant Office 08-10-1995 M Clerk 10000
106 Vinod Purchase 12-12-1994 M Clerk 10000

(i) Select sum(Salary) from Employee where Gender = ‘F’ and Dept =
‘Sales’;
(ii) Select Max(DOB), Min(DOB) from Employee;

Page 7 of 10
(iii) Select Gender, Count(*) from Employee group by Gender;
37 Write a function AddCustomer(Customer) in Python to add a new Customer 3
information NAME into the List of CStack and display the information.
OR
Write a function DeleteCustomer() to delete a Customer information from a
list of CStack. The function delete the name of customer from the stack.
SECTION - III
38 Intelligent Hub India is a knowledge community aimed to uplift the standard 5
of skills and knowledge in the society. It is planning to setup its training
centres in multiple towns and villages of India with its head offices in the
nearest cities. They have created a model of their network with a city, a town
and 3 villages as given.
As a network consultant, you have to suggest the best network related
solution for their issues/problems raised in (i) to (v) keeping in mind the
distance between various locations and given parameters.

Page 8 of 10
Note:
* In Villages, there are community centres, in which one room has been given
as training center to this organization to install computers.
* The organization has got financial support from the government and top IT
companies.
1. Suggest the most appropriate location of the SERVER in the YHUB (out
of the 4 locations), to get the best and effective connectivity. Justify your
answer.
2. Suggest the best wired medium and draw the cable layout (location to
location) to efficiently connect various locations within the YHUB.
3. Which hardware device will you suggest to connect all the computers
within each location of YHUB?
4. Which server/protocol will be most helpful to conduct live interaction of
Experts from Head office and people at YHUB locations?
5. Suggest a device/software and its placement that would provide data
security for the entire network of the YHUB.

39 Write SQL commands for the following queries (i) to (v) based on the relation 5
Trainer and Course given below:

Page 9 of 10
(i) Display the Trainer Name, City & Salary in descending order of
their Hiredate.
(ii) To display the TNAME and CITY of Trainer who joined the Institute
in the month of December 2001.
(iii) To display TNAME, HIREDATE, CNAME, STARTDATE from
tables TRAINER and COURSE of all those courses whose FEES
is less than or equal to 10000.
(iv) To display number of Trainers from each city.
(v) To display the Trainer ID and Name of the trainer who are not
belongs to ‘Mumbai’ and ‘DELHI’
40 Given a binary file “emp.dat” has structure (Emp_id, Emp_name, 5
Emp_Salary). Write a function in Python countsal() in Python that would read
contents of the file “emp.dat” and display the details of those employee
whose salary is greater than 20000.
OR
A binary file “Stu.dat” has structure (rollno, name, marks).
(i) Write a function in Python add_record() to input data for a record
and add to Stu.dat.
(ii) Write a function in python Search_record() to search a record from
binary file “Stu.dat” on the basis of roll number.

*****

Page 10 of 10

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy