54 Hs Xii A SC Com CSC 23

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Total No.

of Printed Pages—11
HS/XII/A.Sc.Com/CSc/23

2023

COMPUTER SCIENCE

( Theory )

Full Marks : 70

Time : 3 hours

The figures in the margin indicate full marks for the questions

General Instructions :
(i) Write all the answers in the Answer Script.
(ii) Attempt multiple choice questions and very short
answer-type questions serially.
(iii) Attempt all parts of a question together at one place.

1. Choose the correct option from the following : 1×6=6

(a) What will be the value of the following expression?


14 + 13% 15

(i) 14

(ii) 27

(iii) 12

(iv) 0

/54 [ P.T.O.
( 2 )

(b) Which of the following represents the mode of both


writing and reading in binary format in file?
(i) wb+
(ii) w
(iii) wb
(iv) w+

(c) Data structure stack is also known as _____ list.


(i) first in first out
(ii) first in last out
(iii) last in first out
(iv) All of the above

(d) Which of the following function headers is correct?


(i) def f(a=1, b):
(ii) def f(a=1, b, c=2):
(iii) def f(a=1, b=1, c=2):
(iv) def f(a=1, b=1, c=2, d):

(e) In the given query which keyword has to be inserted?


INSERT INTO employee _____ (1002, Kausar,
2000);
(i) table
(ii) values
(iii) relation
(iv) field

HS/XII/A.Sc.Com/CSc/23/54 [ Contd.
( 3 )

(f) In order to open a connection with MySQL database


from within Python using MySQL connector package,
_____ function is used.

(i) open()

(ii) database()

(iii) connect()

(iv) connectdb()

2. Answer the following questions in not more than 2 (two) or


3 (three) sentences each : 1×6=6

(a) Write the output for the following code :


for i in range (2, 10, 3) :
print (i)

(b) Given the list :


L = [1, 3, 6, 82, 5, 7, 11, 92]
write the output of the following statement :
print (L[2:5])

(c) Write the different components of a function header.

(d) What are CSV files?

(e) Write an SQL query to delete the employee record


having Name as ‘Siddharth’ from ‘emp’ table.

(f) What are the network protocols?

HS/XII/A.Sc.Com/CSc/23/54 [ P.T.O.
( 4 )

3. Answer any six of the following questions : 2×6=12

(a) What is the difference between readline() and


readlines() functions?

(b) Convert the expression (A+B)/C into prefix


expression.

(c) Differentiate between fruitful and non-fruitful


functions.

(d) Explain the tell() and the seek() functions of Python.

(e) How is append() different from extend() in list?

(f) Compare and comment on the following two return


statements :
return
return n1, n2

(g) What is a string slice? Give one example.

(h) Predict the output of the following program :


def func (message, num=1):
print (message * num)
func (‘Python’)
func (‘Easy’, 3)

4. Answer any three of the following questions : 2×3=6

(a) Give one advantage and one disadvantage of Star


topology.

(b) Differentiate between FTP and HTTP.

HS/XII/A.Sc.Com/CSc/23/54 [ Contd.
( 5 )

(c) Differentiate between HTML and XML.

(d) Name the different types of wired communication


media in computer networking.

(e) When are repeaters required in computer network?

5. Answer any two of the following questions : 2×2=4

(a) Define the terms (i) primary key and (ii) foreign key.

(b) Write a query to display the name of an employee


from the table ‘Employee’ whose name contains ‘R’ as
the last alphabet.

(c) Differentiate between CHAR and VARCHAR data


types.

(d) Write the SQL commands to do the following :

(i) To view the structure of the table ‘Student’

(ii) To delete the table ‘Student’

6. Answer the following questions : 3×4=12

(a) What are the three types of formal arguments?


Explain with examples.

(b) Consider the following codes and write the flow of


execution for this. Line numbers have been given for
your reference :

1. def power (b, p) :

2. y = b * * p

HS/XII/A.Sc.Com/CSc/23/54 [ P.T.O.
( 6 )

3. return y

4.

5. def CalcSquare (x) :

6. a = power (x, 2)

7. return a

8.

9. n = 5

10. result = CalcSquare (n)

11. print (result)

Or

Predict the output of the following program :


c = 10
def add ():
global c
c = c+2
print (“Value of c=”, c)
return (c+5)
print (“Value of c=”, c)
x = add()
print (“value of x=”, x)

HS/XII/A.Sc.Com/CSc/23/54 [ Contd.
( 7 )

(c) What is the output of the following program?

out = open (“output.txt”, “w”)

out.write (“Hello, World! \n”)

out.write (“How are you?”)

out.close()

str = open (“output.txt”)

print (str.read())

str.close()

Or

Convert the expression A* (B + (C + D) * (E + F) / G) * H


into postfix.

(d) Write a program that reads the text file and prints
total number of words in the text file.

Or

What are the different modes of opening a binary file?

7. Answer the following questions : 3

(a) John thought “WWW and Internet” are synonyms


i.e. they meant same and can be used
interchangeably. But the teacher said that they are
not same. Help him to explain the meaning of both
the terms with the help of a suitable example of each.

HS/XII/A.Sc.Com/CSc/23/54 [ P.T.O.
( 8 )

Or

(b) Define the following :

(i) Web browser

(ii) Web server

(iii) Web hosting

8. Answer the following questions : 3×3=9

(a) Write the SQL queries with reference to the following


tables :

Table : Employees Table : Emp_Salary

Emp_id (Primary key) Sal_code (Primary key)


Name Emp_id (Foreign key)
Address Salary
City Benefits
Designation

(i) To show Name, Address and City of all


employees living in Paris.

(ii) To display Name and Salary of all Managers.

(iii) To display the maximum Salary of Managers and


Clerks.

HS/XII/A.Sc.Com/CSc/23/54 [ Contd.
( 9 )

Or

Given the table :

Table : Student

Sl_no

Name

Age

Department

Date of adm

Fees

Sex

Write the following SQL queries with reference to the


above table :

(i) To count the number of students with age < 23.

(ii) To list the names of female students who are in


‘Computer’ department.

(iii) To list the names of all students with their date


of admission in ascending order.

(b) What is SQL Join? Explain equi join with example.

HS/XII/A.Sc.Com/CSc/23/54 [ P.T.O.
( 10 )

(c) What is the purpose of ALTER command? Write an


SQL query to increase the salary by R 1,000, for all
who gets salary less than R 5,000 from the table
‘Employee’.
Or
What is the difference between a WHERE clause and
a HAVING clause of SQL SELECT statement? What is
the use of GROUP BY clause?

9. Answer the following questions : 4×2=8

(a) Write a program to create a CSV file to store student’s


data (RollNo, Name, Marks). Obtain data from user
and write 5 records into the file.

Or

Write a function in Python that counts the number of


‘ME’ and ‘MY’ words present in a text file ‘story.txt’.

(b) What are serialization and de-serialization processes?


Explain the functions required for serialization and
de-serialization.

Or

Create two functions Push() and Pop() for performing


Push and Pop operations with a stack containing
integers.

10. Write a Python code to connect a MySQL database namely


‘School’ and then fetch all those records from the table
‘Student’ where grade is ‘A’. 4

HS/XII/A.Sc.Com/CSc/23/54 [ Contd.
( 11 )

Or

Given the following table : 4

Table : STUDENT

Roll No. Name Class DoB Gender City Marks

1 Nanda X 06-06-1995 M Agra 551

2 Saurabh XII 07-05-1993 M Mumbai 462

3 Sanal XI 06-05-1994 F Delhi 400

4 Trisla XII 08-08-1995 F Mumbai 450

5 Stort XII 08-10-1995 M Delhi 369

6 Marisla XI 12-12-1994 F Dubai 250

7 Neha X 08-12-1995 F Moscow 377

8 Nishant X 12-06-1995 M Moscow 489

(i) SELECT COUNT(*), city FROM STUDENT GROUP BY


CITY HAVING COUNT(*) > 1;

(ii) SELECT MAX(DoB), MIN(DoB) FROM STUDENT;

(iii) SELECT Name, Gender FROM STUDENT WHERE


City = “Delhi”;

(iv) SELECT Name FROM STUDENT ORDER By Name;

HHH

HS/XII/A.Sc.Com/CSc/23/54 K23—2610

You might also like