Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

15848midterm Cs Python El

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

CBSEGuess.

com

Half Yearly Examination (2019 - 2020)


M.M.: 70 Class – XI
Time: 3 hrs. Name of the Student____________________ Roll No.__ Subject- Computer Science

Q1. Do as directed: [10x1=10]


1 for x in range(0,8): 6 #Give output:
if (x==4):
break for p in range(97,101,1):
print(x) print(chr(p) ,end = “ ”)
# Give output
2 for x in range(4): 7 Convert (2) in while
print(x,2**x)
#Give output
3 C=1 8 va=input(“”)
while C<150: if va==‟j‟:
print(C) print(“January”)
C=C *2 elif va==‟A‟:
#Give output print(“April”)
else:
print(“rest Month”)
#Give output if va= „a‟
4 for d in range(-8,-5,2): 9 c=1
print(d+1) for x in range(-10,-100,-30):
#Give output c=c+1
print(„Value is ‟,c)
#Give output
5 for c in range(1,4): 10 N,x,R=131,0,0
print(c) CN=N
if c==4 while N !=0:
break x=N%10
R = (R*10) + x
# Rectify the code such that output N=N//10
should be 1,2,3,4 print(R==CN)
#Give output

Q2. Write programs in Python using loops. [4+4+2=10]


1. Write a program to accept three numbers, add them and now check whether added number is a prime
number or not. [A prime number is a number having only two factors i.e. 1 and the number itself]
2. Write a program to accept a number , generate Fibonacci series till that number and print only ODD
numbers of the series generated. [If user entered 8, series generated should be 0 , 1 , 2 , 3 , 5 , 8, 13,
21. Now the output should be 1 , 3 , 5 , 13 , 21]
3. Write a program to print the following series
2 , 42 , 6 , 82 , 10, 122, 14, 162

Q3. Answer the following: [10x1=10]


1. What is SEP? Where it is used?
2. Differentiate between hex() and oct()
3. What do you mean by the term abbrebiative if?
4. What is slicing concept of Strings?
5. In how many ways, indexes of Strings are numbered?
6. What is „break‟ keyword used for?
7. Give example of „pass‟ statement.
8. What do you mean by the term identifiers?
9. What is the purpose of the function FIND()? Give example
10. What is the purpose of capitalize()? Give example.

--------------------------------------------------------------------------------------------------------
CBSE Sample Papers | CBSE Guess Papers | CBSE Practice Papers | Important Questions | CBSE PSA | CBSE OTBA |
Proficiency Test | 10 Years Question Bank | CBSE Guide | CBSE Syllabus | Indian Tutors | Teacher' Jobs CBSE eBooks |
Schools | Alumni | CBSE Results | CBSE Datesheet | CBSE News
CBSEGuess.com

Q4. Write programs in Python using Strings and Library: [2.5 x 4 = 10]
1. Write a program to accept a String and print it in reverse. [If user enters MAD output should be DAM]
2. Write a program to accept a String and print count of letter „a‟ or „A‟ in the entered in it. [If String
entered is „Anaconda‟ then output should be 3]
3. Write a program to accept a String and N (integer) and print first N letters of it. [If user enters
“MY NATION” , 6 output should be MY NAT]
4. Write a program to accept a String and print only capital letters entered from the String entered.
[Input: “An APPle a Day” Output: AAPPD]
Q5. Answer the following using SQL: [10x1=10]
1. What do you mean by the term relationship in database?
2. From the table given below, give its Degree and Cardinality
Name Activity
Omm Gupta Reading
Rishi Pandey Singing
Skand Agarwal Talking

3. What is Primary key?


4. What are constraints?
5. What do you mean by the term Unique?
6. How Cartesian Product of two table is calculated?
7. What is the use of DISTINCT clause used in select statement?
8. Give the error, if any: Select NAME, AGE from TBL_1 where SAL = NULL;
9. What will be the output: Select 4500*10/100;
10. Write its equivalent query giving same output: SELECT NAME, AGE from TBL_1 where SAL >=1000
and SAL <=2000;

Q6. Answer the following using SQL single table: [8+2=10]


Mr. Devottam, a database administrator in “Global Educational and Training Institute” has created
following table named “Training” for the upcoming training schedule:
Training
Training_Id Name Email_Id Topic City Fee
ND01 Mr. Rajan raj@gmail.com Cyber Security New Delhi 10000
GU01 Ms. Urvashi urv@yahoo.com ICT in Education Gurugram 15000
FD01 Ms. Neena neena@rediff.com Cyber Security Faridabad 12000
ND02 Mr. Vinay NULL ICT in Education New Delhi 13000
GU02 Mr. Naveen nav@gmail.com Cyber Security Gurugram NULL

(1) Help him in writing SQL query for the following purpose:
i. Display the Training_Id of „Cyber Security‟ who does not belong to „New Delhi‟.
ii. Show average Fee from the table .
iii. Give Name , Email_Id where Name ending with „n‟ .
iv. To count how many female candidates will be attending the training.
v. To display list of free trainings.
vi. To display all the cities where Cyber Security training is scheduled along with its fee.
vii. To add a column feedback with suitable data type.
viii. To remove the column Fee from the above table.

(2) Observe the table named “Training” given above carefully and predict the output of the following
queries:
i. select City from training where Topic = 'Cyber Security';
ii. select count(Training_Id) from training where Email_Id like '%gmail% ';
iii. select AVG (Fee) from training where Topic = 'Cyber Security';
iv. select Name from training where Fee between 12500 and 14500;

--------------------------------------------------------------------------------------------------------
CBSE Sample Papers | CBSE Guess Papers | CBSE Practice Papers | Important Questions | CBSE PSA | CBSE OTBA |
Proficiency Test | 10 Years Question Bank | CBSE Guide | CBSE Syllabus | Indian Tutors | Teacher' Jobs CBSE eBooks |
Schools | Alumni | CBSE Results | CBSE Datesheet | CBSE News
CBSEGuess.com

Q7. Answer the following using SQL multi table / Mongo DB : [4x1+1x2+1x4=10]
1. What are the key features of mongodb?
2. What is sharding?
3. What kind of NoSQL database MongoDB is?
4. What is the use of limit() method?
5. Write SQL command for to create the table “Books“ with the following structure:

Field Type Constraint


Book_Id Varchar(6) Primary Key
Book_Name Varchar(25) Not Null
Author_Name Varchar(30)
Publisher Varchar(20)
Price Integer <1000
Type Char(15)

6. Consider the following tables VEHICLE & CUSTOMER:

Table : VEHICLE

Vcode VehicleName Make Color Capacity Price


501 A-Star Suzuki Red 3 4
503 Indigo Tata Silver 3 4
502 Innova Toyota White 7 15
509 SX4 Suzuki Silver 4 14
510 C Class Mercedes Red 4 35

Table :CUSTOMER

Ccode Vcode CName City


1001 501 Hemant Sahu Chandigarh
1001 509 Raj Lal Amritsar
1002 503 Feroza Shah Banglore
1003 503 Ketan Dhal Delhi
1003 509 BM Rai Amritsar

i. Identify the primary key and foreign key in customer table.


ii. Write SQL command to display the Vcode, CName and City of those customers who have purchased
Indigo Or A-Star.
iii. Write a query to show the VehicleName and City of the Vcode 509
iv. Write a query to show the highest and lowest Price of each Make.

===========================================

--------------------------------------------------------------------------------------------------------
CBSE Sample Papers | CBSE Guess Papers | CBSE Practice Papers | Important Questions | CBSE PSA | CBSE OTBA |
Proficiency Test | 10 Years Question Bank | CBSE Guide | CBSE Syllabus | Indian Tutors | Teacher' Jobs CBSE eBooks |
Schools | Alumni | CBSE Results | CBSE Datesheet | CBSE News

You might also like