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

Cs 1

The document describes a sample question paper for class 12 computer science subject. It contains 5 sections with a total of 35 questions ranging from 1 to 5 marks. The questions are from different topics related to computer science like Python programming, databases, operating systems etc.

Uploaded by

C1A 05 Ashwina J
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)
192 views8 pages

Cs 1

The document describes a sample question paper for class 12 computer science subject. It contains 5 sections with a total of 35 questions ranging from 1 to 5 marks. The questions are from different topics related to computer science like Python programming, databases, operating systems etc.

Uploaded by

C1A 05 Ashwina J
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/ 8

SAMPLE PAPER-I

STD XII SUB : CS (083)

DATE: MAX. MARKS: 70 marks


MAX. TIME: 3 hrs
General Instructions:
 Please check this question paper contains 35 questions.
 The paper is divided into 4 Sections- A, B, C, D and E.
 Section A, consists of 18 questions (1 to 18). Each question carries 1 mark.
 Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
 Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
 Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
 Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
 All programming questions are to be answered using Python Language only.

Sno Question Mark


Section – A
1 Identify the invalid identifier out of the options given below. 1
a) Qwer_12 b) IF c) Play123 d) Turn.over

2 What should be the data type for the column IFSC_Code storing alphanumeric bank 1
branch code have 11 characters, eg., INBK0088200 ?

a) VARCHAR2(50) b) NUMBER c) Char(11) d) NUMBER(11)

3 What will be the value of p when p=int(17//2+11.5) ? 1


a) 19 b) 19.0 c) 20 d) 19.5

4 What will be the output of the following python code ? 1


L = [10,20]
L1 = [30,40]
L2 = [50,60]
L.append(L1)
L.extend(L2)
print(L)
print(len(L))

5 _____ is a non-key attribute, whose values are derived from the primary key of some 1
other table.

a) Primary Key b) Candidate Key c) Foreign Key d) Alternate Key

6 Which of the following transmission media has the highest bandwidth? 1


a) Co-axial cable b) Fiber optic cable c) Twisted pair cable d) None of these

1
7 What will be the output for the following python statements ? 1

D={'RAJAN' : 90, 'ZEESHAN' : 96, 'LISA' : 85}


print('RAJAN' in D, 96 in D, sep = '&')

a) True&False b) True&True c) False&True d) False&False

8 Consider the statements given below and then choose the correct output from the given 1
options:
pride="#G20 2023INDIA"
print(pride[-2:2:-3])
a) II00 b) AN32 c) D320 d) 20GA

9 Which of the following statement(s) would give an error after executing the following 1
code?
print(9/2) # Statement-1
print(9//2) # Statement-2
print(9%%2) # Statement-3
print(9%2) # Statement-4
a) Statement-1 b) Statement-2 c) Statement-3 d) Statement-4

10 Which of the following random module functions generated a floating point number? 1
a) random() b) randint() c) uniform() d) all of these

11 Write the full form of NIC 1


a) New Interface Card b) Network Interface Card
c) New Internet Card d) Network Internet card

12 What is the order of resolving scope of a name in a python program? 1


a) BGEL b) LEGB c) GEBL d) LBEG

13 An unexpected event that occurs during runtime and causes program disruption, is called:
a) Compile time error b) Logical error c) Runtime error d) Exception

14 All aggregate functions ignore NULLs except for ________ function.


a) Distinct b) Count(*) c) Average() d) None of these

15 __________ address is assigned to network cards by the manufacturer.


a) IP b) MAC c) unique d) domain

16 A database _________ controls the connection to an actual database, established from


within a Python program.
a) database object b) connection object
c) fetch object d) query object

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

2
(d) A is false but R is True

17 Assertion(A): A data structure that contains the value sequentially or linearly is known as
linear data structure.
Reasoning(R): Lists and tuples are linear data structures

18 Assertion(A): The tell method will stores / get the current location of the file pointer.
Reasoning(R): Python seek method returns the current position of the file read / write
pointer within the file.

SECTION – B
19 Define web browser and web server 2
(OR)
What is the difference between Packet switching and circuit switching techniques?
20 Anita has written a code to input a number and check whether it is prime or not. His code 2
is having errors. Rewrite the correct code and underline the corrections made.

def prime():
n=int(input("Enter number to check :: ")
for i in range (2, n//2):
if n%i=0:
print("Number is not prime \n")
break
else:
print("Number is prime \n’)
prime()

21 i) 2
Given is a Python string declaration:
myexam="ComputerScience"
Write the output of :
print(myexam[-2:2:-2])

(OR)

ii) Write the output of the code given below:

dictcount={'age1':26,'age2':32,'age3':40}
sum=0
for key in dictcount:
sum=sum+dictcount[key]
print(sum)

22 Write a function Count_My(SUBJECT) in Python, that takes the dictionary, 2


SUBJECT as an argument and displays the names (in uppercase) of the
subjects whose names are longer than 5 characters. For example, Consider the
following dictionary
SUBJECT={1:"Computer",2:"Physics",3:"Chemistry",4:"Hindi",5:"Math"}
The output should be:
3
COMPUTER
PHYSICS
CHEMISTRY

23 Write a suitable Python statement for each of the following tasks using built-in 2
functions/methods only:
i) To delete an element Chennai : 06 from Dictionary DICT.
ii) To display words in a string S in the form of a list.

(OR)

Write a Python Program to display alternate characters of a string my_Str


For example, if my_Str = "Data Science"
The output should be eniSaa

24 Differentiate Where and Having clause in SQL with example. 2

(OR)

Write the difference between PRIMARY KEY and UNIQUE KEY in SQL.

25 Write the output of the following: 2

p=8
def sum(q,r=5):
global p
p=(r+q)**2
print(p, end= '#')
a=2; b=5;
sum(b,a)
sum(r=3,q=2)

SECTION - C
26 Predict the Output of the Python code given below: 3

s='welcome2cs'
n=len(s)
m=''
for i in range(0,n):
if(s[i]>'a' and s[i]<='m'):
m=m+s[i].upper()
elif(s[i]>='n' and s[i] <= 'z'):
m=m+s[i-1]
elif(s[i].isupper()):
m=m+s[i].lower()
else:
m=m+'&'
print(m)

27 Monika is a senior clerk in a MNC. She created a table ‘Salary’ with a set of records to 3
keep ready for tax calculation. After creation of the table, she has entered data of 5

4
employees in the table.

Based on the table given above write the SQL Queries:


(i) Display the Emp_Name and Gross salary of each employee. (Gross=
basic+da+hra+nps)
(ii) Increase the DA by 3% of respective basic salary of all employees.
(iii) Delete the Attribute emp_desig from the table.

28 A text file “PYTHON.TXT” contains alphanumeric text. Write a program that reads this 3

text file and writes to another file “PYTHON1.TXT” entire file except the numbers or
digits in the file.

(OR)

A pre-existing text file data.txt has some words written in it. Write a python function
displaywords( ) that will print all the words that are having length greater than 3.
If the contents of file is :
A man always wants to strive higher in his life
He wants to be perfect.
The output should be: always wants strive higher life wants perfect.

29 (a) Differentiate between Natural join and Equi join. 3

(b)Table : Employee

Give the output of following SQL statement:

(i) Select Name, JobTitle, Sales from Employee,Job where Employee.JobId=


Job.JobId and JobId in (101,102);

5
(ii) Select JobId, count(*) from Employee group by JobId;

30 Thushar received a message(string) that has upper case and lower case 3
alphabet. He want to extract all the upper case letters separately .Help him to do
his task by performing the following user defined function in Python:

a) Push the upper case alphabets in the string into a STACK


b) Pop and display the content of the stack.
For example:
If the message is “All the Best for your Pre-board Examination”
The output should be: E P B A

SECTION – D
31 Consider the table PRODUCT and CLIENT given below: 4

Write SQL Queries for the following :


i) Display the details of those clients whose city is DELHI
ii) Increase the Price of all Bath soap by 10
iii) Display the details of Products having the highest price
iv) Display the product name , price, client name and city with their
corresponding matching product Id.

32 A csv file “ result.csv” contains record of student in following order 4


[rollno, name, sub1,sub2,sub3,total]

Initially student total field is empty string as example data is given below
['1', 'Anil', '40', '34', '90', '']
['2', 'Sohan', '78', '34', '90', '']
['3', 'Kamal', '40', '45', '9', '']

A another file “final.csv” is created which reads records of “result.csv” and copy all
records after calculating total of marks into final.csv. The contents of final.csv
should be
['1', 'Anil', '40', '34', '90', '164']
['2', 'Sohan', '78', '34', '90', '202']
6
['3', 'Kamal', '40', '45', '9', '94']

(a) Define a function createcsv() that will create the result.csv file with the
sample data given above.
(b) Define a function copycsv() that reads the result.csv and copy the same
data after calculating total field into final.csv file.

SECTION – E
33 India Tech Solutions (ITS) is a professional 5
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.

(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.
(iii)What will be the best possible connectivity out of the following, you will suggest to
connect the new set up of offices in Bangalore with its London based office.
• Satellite Link
• Infrared
• Ethernet
(iv)Which of the following device will be suggested by you to connect each computer in
each
of the buildings?
• l Switch
• l Modem
• l Gateway

7
(v) Company is planning to connect its offices in Hyderabad which is less than 1 km.
Which type of network will be formed?

34 (i) Differentiate between rb+ and wb+ file modes in Python. 5


(ii) Consider a binary file “employee.dat” containing details such as
(empno, ename, salary). Write a python function to display details of those employees
who are earning between 20000 and 30000 (both values inclusive).

(OR)

(i) Differentiate between dump and load functions in binary files?


(ii) Write a Python function in Python to search the details of the employees
[name, designation, salary] whose salary is greater than 5000. The
records are stored in the file “emp.dat”. consider each record in the file
‘emp.dat’ as a list containing name, designation and salary.

35 (i) Define the term constraint with respect to RDBMS. Give a suitable example. 5
(ii) Virat has created a table named TRAVELS in MySQL:
Tour_ID – string
Destination – String
Geo_Cond– String
Distance – integer (In KM)
Note the following to establish connectivity between Python and MYSQL:
 Username is root
 Password is bharat
 The table TRAVELS exists in a MYSQL database named TOUR.
 The details Tour_ID, Destination, Geo_Cond and Distance are to be accepted
from the user.
Virat wants to display All Records of TRAVELS relation whose Geographical condition
is hilly area and distance less than 1000 KM. Help Virat to write program in python.

(OR)

i) Mr. Sandeep created two tables with DEPTNO as Primary key in Table1 and Foreign
key in Table2. While inserting a row in Table2, Mr. Sandeep is not able to enter a value
in the column DEPTNO. What could be the possible reason for it?

ii)
Consider the following table structure
Table : Faculty
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

You might also like