question bank for bright students chapter wise sub ... · question bank for bright students chapter...

13
QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB-COMPUTER SCIENCE CLASS-XI CHAPTER 1 GETTING STARTED WITH PYTHON 1 What is the difference between interactive node and script mode inPython? 2 What will be the output of following code: #this is a sample program #to output simple statements #print (“such as “) Print(“take every change.”) Print(“drop every fear.”) 3 What is a cross-platform software? 4 What are some limitations of Python programming language? 5 In how many different ways, can you work in Python? CHAPTER 2 PYTHON FUNDAMENTALS 1 Out of the followings, Find those identifiers, which cannot be used for naming Variables, Functions in a Python programming language: Roll#No, continue, True, 41stno, _v1, No_2, false, Var1 2 Write the following operators according to the precedence rule : or, and, not, <>, *, **, () 3 Which of the following is not a legal string operation and Why: >>>"KV"+"KDML" % 2 , >>>'Kendriya'+'Vidyalaya' >>>"K"+"V"+"KDML", >>>'KV' * 5 4 Write the following mathematics expression in python code: (i) | − | + (+) 3 (−) (ii) √ +( + ) 3 2 5 Write a python program which will accept an integer N and check whether it is a 3 digit number or not. CHAPTER 3 DATA HANDLING 1 What will the result given by the following?

Upload: others

Post on 23-Mar-2020

135 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB ... · QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB-COMPUTER SCIENCE CLASS-XI CHAPTER 1 GETTING STARTED WITH PYTHON 1 What

QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE

SUB-COMPUTER SCIENCE

CLASS-XI

CHAPTER 1

GETTING STARTED WITH PYTHON

1 What is the difference between interactive node and script mode inPython?

2 What will be the output of following code: #this is a sample program #to output simple statements #print (“such as “) Print(“take every change.”) Print(“drop every fear.”)

3 What is a cross-platform software?

4 What are some limitations of Python programming language?

5 In how many different ways, can you work in Python?

CHAPTER 2

PYTHON FUNDAMENTALS

1 Out of the followings, Find those identifiers, which cannot be used for naming Variables, Functions in a Python programming language:

Roll#No, continue, True, 41stno, _v1, No_2, false, Var1

2 Write the following operators according to the precedence rule :

or, and, not, <>, *, **, ()

3 Which of the following is not a legal string operation and Why:

>>>"KV"+"KDML" % 2 , >>>'Kendriya'+'Vidyalaya'

>>>"K"+"V"+"KDML", >>>'KV' * 5

4 Write the following mathematics expression in python code:

(i) |𝑎 − 𝑏| + (𝑎+𝑏)3

(𝑏−𝑐) (ii) √𝑐𝑜𝑠 𝑥+(𝑎 + 𝑏)3 − 𝑎2

5 Write a python program which will accept an integer N and check whether it is a 3 digit number or not.

CHAPTER 3

DATA HANDLING

1 What will the result given by the following?

Page 2: QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB ... · QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB-COMPUTER SCIENCE CLASS-XI CHAPTER 1 GETTING STARTED WITH PYTHON 1 What

i.type(6+3), ii. type(6/3)

2 What will be the output produced by following code? a = 5-4-3 b=3**2**3 print(a) print(b)

3 What is the difference between mutable and immutable? Explain with example.

4 What will be the output produced by following code?

x=20 x=x+5 x=x-10 print(x) x,y=x-1,50 print (x,y)

5 Write a program in python to take marks of 5 different subjects as inputs then calculate the average .if the average is >33 print pass else print fail

CHAPTER 4

CONDITIONAL AND ITERATIVE STATEMENTS

1 Correct the errors in the following code. Underline each correction.

w = “Raining” if w = “sunny” : print(“Wear Sun Block’) elif : w= “snow” print(“Going Skiing”) else: print(Wheather)

2 What will be the output of the following python code:If the string entered in name variable as: “PYTHON”

LS = [1, 9, 6,7, 80, 90] ln=len(LS) for k in range(0,ln): print(LS[k], end=" , ") print("\n Conversion Print: ") for k in range(-1,-(ln+1),-1): print(LS[k], end=" , ")

3 Write the output of the following code:

v=5

if(v+5==11):

print((v+5==11)+1)

else:

print((v+5==11)+2)

Page 3: QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB ... · QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB-COMPUTER SCIENCE CLASS-XI CHAPTER 1 GETTING STARTED WITH PYTHON 1 What

print(v+5<=10)

4 Draw a flow chart to find whether a number is even or odd.

5 Write a program to find the roots of a quadratic equation ax2+bx+c. Hints: The roots are (–b+√(b2-4ac))/2a and (–b-√(b2-4ac))/2a

CHAPTER 5

STRING MANIPULATION

1 Find the output x = “hello world”

print(x[:2], x[-2:]) print(x[2:-3], x[-4:-2])

2 Find the output

forthefollowing::

str=”Kendriyavidyalaya

GreaterNoida”

print(“Line1”,str[19],

end=’#’) print(“\t”,str[4:7])

print(str*3, str[27:]), sep=”***”)

3 Given a String s=”KendriyaVidyalaya”. If n=int(len(s)/2), then what will be the output of the following statements:

>>>print(s[0:n]), >>>print(s[0:3]), >>>s[:n], >>>s[n:]

4 Find the output of the following: i)a = True

b = False

c = False

if a or b and c:

print “ KVS IS BEST”

else:

print “kvs is best”

ii)string = ‘It goes as – ringaringa roses’

sub = ‘ringa’

print ( string.find( sub, 15, 25 ))

5 Write a python script that traverses through an input string and prints its characters in different lines – two characters per line.

CHAPTER 6

DEBUGGING PROGRAMS

Page 4: QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB ... · QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB-COMPUTER SCIENCE CLASS-XI CHAPTER 1 GETTING STARTED WITH PYTHON 1 What

1 What are main error types? Which types are most dangerous and why?

2 What is a difference between an error and exception?

3 Name some common built-in exceptions in Python.

4 when does these exception occur?

(a) Type Error (b) Index Error (c) Name Error

5 What is debugging and code tracing?

CHAPTER 7

LIST MANIPULATION

1 Start with the list[8,9,10]. Do the following using list functions (a) Set the second entry (index 1) to 17 (b) Add 4, 5 and 6 to the end of the list. (c) Remove the first entry from the list. (d) Sort the list. (e) Double the list. (f) Insert 25 at index 3

2 If a is [1, 2, 3], what is the difference (if any) between a*3 and [a, a, a]?

3 If a is [1, 2, 3], is a *3 equivalent to a + a + a?

4 Does a slice operator always produce a new list?

5 What are nested Lists?

CHAPTER 8

TUPLES

1 WAP that creates a tuple storing first 9 items of Fibonacci Series.

Page 5: QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB ... · QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB-COMPUTER SCIENCE CLASS-XI CHAPTER 1 GETTING STARTED WITH PYTHON 1 What

2 WAP that creates a third tuple after adding two tuples. Add second after first tuple.

3 WAP to calculate the mean of the numbers of the tuple.

4 WAP to calculate the average of the numbers of the tuple.

5 Find out the output generated by following code fragments: (a) plane = (“Passengers”, ”Luggage”) plane [1] = “Snakes” (b) (a, b, c) = (1,2,3) (c) (a, b, c, d) = (1,2,3) (d) a, b, c, d = (1,2,3) (e) a, b, c, d, e = (p, q, r, s, t) = t1

CHAPTER 9

DICTIONARIES

1 Create a dictionary whose keys are month manes and whose values are the number of days in the corresponding months.

(a) Ask the user to enter a month name and use the dictionary to tell how many days are in the month.

(b) Print out all of the keys in alphabetical order.

(c) Print out all of the months with 31 days.

(d) Print out the (key-value) pairs sorted by the number of days in each month.

2 Can you store the details of 10 students in a dictionary at the same time? Details include – rollno, name, marks, grade etc, give example to spot our answer.

3 Given the dictionary x = {‘k1’:’v1’,’k2’:’v2’,’k3’:’v3’}, create a dictionary with the opposite mapping , i.e., write a program to create the dictionary as : Inverted_x = {‘v1’:’k1’,’v2’:’k2’,’v3:’k3’}

4 Given two dictionaries say d1 and d2. Write a program, that lists the overlapping keys of the two dictionaries , i.e. if a key of d1 is also a key of d2, the list it.

5 Write a program that checks if two same values in a dictionary have different keys. That is, for dictionary d1 = {‘a’:10,’b’:20,’c’:10}, the program should print “2 keys have same values” and for dictionary d2 = {‘a’:10,’b’:20,’c’:10}, the program should print “No keys have same values”.

CHAPTER 10

UDERSTANDING SORTING

1 What is the basic principal of sorting in Insertion sort?

Page 6: QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB ... · QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB-COMPUTER SCIENCE CLASS-XI CHAPTER 1 GETTING STARTED WITH PYTHON 1 What

2 number of operations wise, compare bubble sort and insertion sort techniques.

3 Why insertion sort is considered a better algorithm than bubble sort?

4 In which situations, insertion sort also becomes inefficient?

5 When and why would you choose insertion sort over bubble sort?

CHAPTER – 11

STATE AND TRANSITIONS

1 What are state transition diagrams?

2 What is the utility of state transition diagram?

3 What does a state signify?

4 How is a transition linked to states?

5 Draw a state transition diagram for operation of an ATM machine.

CHAPTER – 12

COMPUTER SYSTEM OVER VIEW

1 What is system software ?what role does it play in the functioning of the computer ?

2 Discuss the role of utility software in the context of computer performance.

3 What is the importance of an OS?

4 How are software libraries useful ?name some software libraries of Python.

5 What is the utility of these software ? (a) Disk fragmentor

(b) Backup software

CHAPTER – 13

DATA REPRESENTATION

1 Convert the following binary numbers to decimal : (a) 1010 (b) 111010 (c) 101011111

2 Convert the following binary numbers to decimal : (a) 1100 (b) 10010101 (c) 11011100

Page 7: QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB ... · QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB-COMPUTER SCIENCE CLASS-XI CHAPTER 1 GETTING STARTED WITH PYTHON 1 What

3 Convert the following decimal numbers to binary: (a) 23 (b) 100 (c) 145

4 Convert the following decimal numbers to binary: (a) 19 (b) 121 (c) 161

5 Convert the following hexadecimal numbers to binary: (a) A6 (b) A07 (c) 7AB4

CHAPTER – 14

BOOLEAN LOGIC

1 Draw the logical circuits for the following using NOR gates only:

(i) (x+y).(x’+y).(x’+y’)

(ii) (x+y+z).(x+y’+z’)

2 What function is implemented by the circuit shown?

(A) X’Y’ + Z (B) (X’+Y’)Z (C) X’Y’Z (D) X’+Y’+Z (E) none of these

3 What function is implemented by the circuit shown?

(A) X+Y+Z (B) X+Y+Z’ (C) X’Y’Z (D) X’+Y’+Z’ (E) none of these

4 What function is implemented by the circuit shown?

(A) XZ’+Y (B) XZ+Y (C) X’Z+Y’ (D) X’Y’ + Y’Z’ (E) X’Y’ + Y’Z

5 What function is implemented by the circuit shown?

Page 8: QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB ... · QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB-COMPUTER SCIENCE CLASS-XI CHAPTER 1 GETTING STARTED WITH PYTHON 1 What

(i) AND (II) OR (III) NAND (IV) NOR (V) None of

these

CHAPTER – 15

INSIGHT INTO PROGRAM EXECUTION

1 How is private cloud different from public cloud?

2 What is parallel computing?

3 How is parallel computing different from serial computing?

4 How is parallel computing different from threading?

5 What are the advantages of parallel computing?

CHAPTER – 16

RELATIONAL DATABASES

1 How are SQL commands classified?

2 What functions should be performed by ideal DDL?

3 Differentiate between DDL and DML commands.

4 Name some commands used to assign / revoke privileges from database users.

5 Name some table maintenance commands.

CHAPTER – 17

SIMPLE QUERIES IN SQL

10 Write SQL commands for the following on the basis of given table STUDENT: TABLE : STUDENT

Studno Cls Name Game Grade1 Supw Grade2

10 7 Sameer Cricket B Photography A

11 8 Sujit Tennis A Gardening C

12 7 Kamal Swimming B Photography B

13 7 Veena Tennis C Cooking A

14 9 Archana Basket Ball

A Literature A

15 10 Arpit Cricket A Gardening C

(i) Display the names of the students who are getting a grade ‘C’ in either

Game or supw.

(ii) Display the different games offered in the school.

Page 9: QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB ... · QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB-COMPUTER SCIENCE CLASS-XI CHAPTER 1 GETTING STARTED WITH PYTHON 1 What

(iii) Display the supw taken up by the students, whose name starts with ‘A’

2 Write SQL commands for the following on the basis of given table SPORTS: Table : SPORTS

Studno Cls Name Game1 Grade1 GAME2 Grade2

10 7 Sameer Cricket B Swimming A

11 8 Sujit Tennis A Skating C

12 7 Kamal Swimming B Football B

13 7 Veena Tennis C Tennis A

14 9 Archana Basket Ball

A Cricket A

15 10 Arpit Cricket A Athletics C

(i) Display the names of the students who are getting a grade ‘C’ in either

Game1 or or game2 or both.

(ii) Display the names of the students who have same game for both game1

and game2.

(iii) Display the games taken up by the students, whose name starts with ‘A’.

3 Write SQL commands for the following on the basis of given table SLUB: Table : CLUB

COACHID Coachname Age Sports Datofapp Pay Sex

1 Kukreja 35 Karate 27/03/1996 1000 M

2 Ravina 34 Karate 20/01/1998 1200 F

3 Karan 34 Squash 19/02/1998 2000 M

4 Tarun 33 Basketball 01/01/1998 1500 M

5 Zubin 36 Swinning 12/01/1998 750 M

6 Ketaki 36 Swinning 24/02/1998 800 F

7 Ankita 39 Squash 20/02/1998 2200 F

8 zareen 37 Karate 22/02/1998 1100 F

9 Kush 41 Swinning 13/01/1998 900 M

10 shailya 37 basketball 19/02/1998 1700 M

(i) To show all information about the swimming coaches in the club.

(ii) To list names of all coaches with their date of appointment in descending

order.

(iii) To display a report, showing coachname, pay, age, and bonus (15% of pay)

for all the coaches.

4 Write SQL commands for the following on the basis of given table student: Table : Student

No Name Stipend Stream Avgmarks Grade Cls

1 Karan 400 Medical 78.5 B 12b

2 Divakar 450 commerce 89.2 A 11c

3 Divya 300 Commerce 68.6 C 12c

4 Arun 350 humanities 73.1 B 12c

5 Sabina 500 nonmedical 90.6 A 11a

6 John 400 Medical 75.4 B 12b

7 Robert 250 humanities 64.4 C 11a

8 Rubina 450 nonMedical 88.5 A 12a

9 Vikas 500 nonMedical 92.0 A 12a

10 mohan 300 Commerce 67.5 c 12c

Page 10: QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB ... · QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB-COMPUTER SCIENCE CLASS-XI CHAPTER 1 GETTING STARTED WITH PYTHON 1 What

(i) Select all the nonmedical stream students from student.

(ii) List the names of those students who are in class 12 sorted by stipend.

(iii) List all students sorted by avgmark in descending order.

(iv) Display a report, listing name, stipend, stream, and amount of stipend

received in year assuming that the stipend is paid every month.

5 Write SQL commands for the following on the basis of given table library: Table : Library

No Title Author Type Pub Qty Price

1 Data structure Lipschutz Ds Mcgraw 4 217

2 Computer studies French Fnd Galgoria 2 75

3 Advanced pascal Schildt Prog Mcgraw 4 350

4 Dbms dummies Palmer Dbms Pustakm 5 130

5 Mastering c++ Gurewich Prog Bpb 3 295

6 Guide network Freed Net Zpress 3 200

7 Mastering foxpro Seigal Dbms Bpb 2 135

8 Dos guide Norton Os Phi 3 175

9 Basic for beginners Morton Prog Bpb 3 40

10 Mastering window cowart os Bpb 1 225

(i) Select all the prog type published by bpb.

(ii) Display a list of all books with price more than 130 nad sorted by qty.

(iii) Display all the books sorted by price in ascending order.

CHAPTER – 18

TABLE CREATION AND DATA MANIPULATION COMMANDS

1 Insert few records with relevant information, in the table.

2 Drop the column CustpmerIncomeGroup from table customer.

3 Create the table Department table based on the following table instance chart.

Column name

Dept_ID DeptName

keytype Primary

Null / Unique

Not null

Dat type

Number Varchar

Length 2 20

4 Create the table Employee table based on the following table instance chart.

Column name

Emp_id Emp_Name Emp_Add1 Emp_Phone EmpSal DeptID

Data type

Number Varchar Varchar Varchar Number Varchar

Length 6 20 30 10 9,2 2

Key type Primary Foreigh

Nulls / Unique

Not null

Fk Table Dept_ID

Page 11: QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB ... · QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB-COMPUTER SCIENCE CLASS-XI CHAPTER 1 GETTING STARTED WITH PYTHON 1 What

5 View structures of all tables created by you.

CHAPTER – 19

TABLE JOINS AND INDEXES IN SQL

1 In a database BANK there are two tables with a sample data given below : Table : employee

Eno Ename Salary Zone Age Grade Dept

1 Mona 70000 East 40 A 10

2 Muktar 71000 West 45 B 20

3 Nalini 60000 East 26 A 10

4 Sanaj 65000 South 36 A 20

5 Surya 58000 North 30 b 30

Table : department

Dept Dname Hod

10 Computers 1

20 Economics 2

30 english 3

Write SQL queries for the following:

(i) To display eno, ename, salary and corresponding dname of all the employees whose age is between 25 and 35.

(ii) To display dname and corresponding ename from the tables department and emplouee,

(iii) To display ename, salary , zone and incometax (note : income tax to be calculated as 30% of salary) of all the employees with appropriate column headings.

2 In a database school there are two tables member and division as shown below:

Table : member Table :division

Empid Name Pay Divno

1001 Shankhya 34000 10

1003 Ridhima 32000 50

1002 sunish 45000 20

Divno Devname Location

10 Media TF02

20 Dance FF02

30 Production SF01

(i) Identify the foreign key in the table member.

(ii) What output, you will get, when an equi-join query is executed to get the NAME from member table and corresponding from division table?

3 Write SQL command to create index on HIRDATE field in table EMPL. Note that the table already exists.

4 Write SQL command to create following table POI with following specifications: Pname is the primary key Create indexes on category and x field.

Table : POI

Pname X Y Category

Cloud gate 1010 915 Sculpture

Pizza joe 1014 915 Restaurant

Fields museum 1016 916 Museum

Moma 1340 830 Museum

Page 12: QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB ... · QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB-COMPUTER SCIENCE CLASS-XI CHAPTER 1 GETTING STARTED WITH PYTHON 1 What

5 In a database there are two tables “product” and “client” as shown below :

Table : product Table : client

Pid Productname Manufacture Price

P001 Moisturiser Xyz 40

p002 Sanitizer Lac 35

P003 Bath soap Cop 25

P004 Shampoo Tap 95

P005 Lens solution Cop 350

cid Clientname City Pid

01 Dreamzdisne New delhi

p002

05 Life line inc Mumbai P005

12 98.4 New delhi

P001

15 Appolo Banglore P003

Write the commands in SQL queries for the following:

(i) To display the details for product whose price is in the range of 40 and 120.

(ii) To display the clientname, city from table client and productname and price from table product, with their corresponding matching pid.

(iii) To increase the price of all the products by 20.

CHAPTER – 20

BASICS OF NOSQL DATABASE - MONGODB

1 Write query to returns documents where field name has double datatype.

2. Write query to set age of mohan as 79.

3. Write query to update all the people records where age is in range 20 to 25 and set their salary to 27000.

4. Write query to remove one document with salary less than 30000.

5. Write query to remove all documents where salary is less than 30000.

CHAPTER – 21

CYBER SAFETY

1 What is cyber crime ?how can you report it?

2 What is cyber bullying and cyber stalking?

3 What is identity fraud?

4 What is digital footprint? Why is it so important?

5 Why are privacy settings of a social networking site so important?

CHAPTER – 22

ONLINE ACCESS AND COMPUTER SECURITY

1 What is phishing?

2 How is pharming similar to and different from phishing?

3 What is (i) authentication (ii) authorization ?why are these two used together?

4 What is the significance of a firewall in a computer’s security scheme?

5 What is eavesdropping ?what security measures can you take up to prevent it?

Page 13: QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB ... · QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SUB-COMPUTER SCIENCE CLASS-XI CHAPTER 1 GETTING STARTED WITH PYTHON 1 What