Previous Year QP

You might also like

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

Previous Year QP

School SCOPE

Course CSE1012 Name of the Problem Solving using Python


Code Course

Date 20 Feb, 2022 Time NA


Slot G+TG Total Marks NA

Ques. No Question Module


Number
Q1 John is having fever. To measure the body 1
temperature John used mercury thermometer.
The thermometer reads the temperature in
Fahrenheit, but John does not understand the
reading in Fahrenheit. Write an algorithm to
display temperature measured by John on the
Celsius scale. Also draw the flowchart for the
given problem.
Q2 Whenever we drop a ball from a specific 1
height, it bounces back it also referred as
bounciness of the ball. Once the bounce height
of the ball is known, we compute the
bounciness index. The bounciness index is
computed as ratio of dropped height of ball to
the how high ball has bounced. Let’s say I
have dropped ball from a height of 10 feet and
it bounced back to 7 feet then the bounciness
index is 0.7 for that ball. The total distance
travelled by ball in this case is 17feet for single
bounce. If ball were to continue bouncing then
the distance covered by ball after two bounces
would be 10 ft. + 7 ft. + 7 ft. + 4.9 ft. = 28.9 ft.
Note that the distance traveled for each
successive bounce is the distance to the floor
plus 0.7 of that distance as the ball comes back
up. Provided the initial drop height, bounciness
index and the number of bounces that are
allowed. Illustrate the solution for the total
distance covered by ball based on bounciness
index by writing an algorithm.
Q3 The faculty decides to award bonus marks to 1
students based on his/her attendance in the
month. Illustrate the marks student will get
with the help of flowchart. Faculty divides the

Page 1 of 4
percentage of attendance with 10 to get the
bonus mark for the student.

Q4 Dmart is offering discount to customer on 2


occasion of Diwali. Dmart has already sold the
four types of coupons based on their yearly
spend at Dmart. Write a python program to
show “congratulation” message along with the
percentage discount customer is getting. The
input to your program should be the coupon
code and it should display the percentage
discount customer is getting. The following
coupon codes were already distributed by
Dmart to their customers.
Dmart coupon codes
1) Freedom -> 10% discount.
2) Freedomsale -> 20% discount.
3) INDEPENDENCE -> 30% discount.
4) No coupon code then no discount.
Q5 To cast vote in election, Indian government 2
has fixed the age limit of 18 years. A person
whose age is greater that 18 years on the
election day is allowed to cast a vote. Given
the age of the person, write a python program
to display whether a person is eligible to cast a
vote or not.
Q6 John wants to design a dart board, and he does 1
not have much space on wall. Help John to
decide the area covered by dart board using the
radius. Provide the solution to John by writing
an algorithm and also illustrate it using
flowchart.
Q7 John owns a video rental shop. John charges 1
Rs. 50 per day as rental for old CD/DVD and
Rs. 80 per day for new CD/DVD video. John is
calculating the charges for each customer
manually. Help john by writing an algorithm to
calculate total rental that customer should pay
to John. Note that customer can rent multiple
video CDs/DVDs.
Q8 University decides to allow students for CAT- 1
1 exam based on his/her attendance in the
class. If the student’s attendance is below 80%
then he/she is not allowed to write an exam.
Show the solution steps to determine the
eligibility of the student for CAT-1 exam,
using the flowchart also write an algorithm for
the same.
Q9 The Delhi government plans to implement the 2
even-odd Vehicle use policy to reduce the
pollution. The government decides that if the
vehicle number plate is even then they can use
it on even days of the month. And if number of
vehicle is odd then they can use it on add days

Page 2 of 4
otherwise people has to face the penalty for
violating the traffic rules. Let’s say ravi uses
car having car number as DL01-BV3456 then
3456 would be the car number, since its even
he is allowed to use car on road on even days
(i.e., 2,4,6…etc.). Help the Delhi government
by writing a python program to show eligible
vehicle on street based on its number plate.
Your program should ask the user to enter last
4 digits of vehicle number and should display
all the dates of the month in which he/she can
use the vehicle in Delhi. (Assume that month
contains 30days only).
Q 10 Students in the university get their grades 2
based on the percentage of marks scored by the
student in the registered course. Write a python
program to display the grade secured by the
student based on his/her marks scored. The
grading table used by the university based on
the total marks scored is as follow:
Marks (M) Grade
M>=90% S
80%<M<90% A
70%<M<=80% B
60%<M<=70% C
50%<M<=60% D
40%<M<=50% E
M<=40% F (Fail)
Q 11 A palindrome number is a number that remains 3
same when its digits get reversed. Write a
python program to check given number is
palindrome or not.
Q 12 On successful completion of admission 3
process, applicant received following message:
“Your admission is confirmed on 23/08/2021
in the CSE-AI program. Your classes will be
starting from 31/08/2021”.
The college admission officer wants to extract
the admission date and class start date from the
above type of messages. Write a python
program to extract the admission date and class
start date from the similar type of messages
received by applicant. [Hint: use RE module
to write program]
Q 13 The college generates and stores the 4
registration numbers of students in a list. The
generated register number has a property that
they are fixed for a student and should not be
changed at any time. Write a program to store
the registration number in a list until user
enters “-1”. Note that you should only add the
registration number in a list if it is not there. If
registration number already exist in a list, then
display the appropriate message. [Note: The

Page 3 of 4
data type in which you are storing list of
registration no. should have read-only
property]
Q 14 Rahul hold the names of the all the cities he 4
has been to in the last 5 years. Rahul wants a
program which will record all the names of
cities and then display them in the alphabetical
order. Write a python program to read all cities
name till Rahul enters “-1” and display them in
the alphabetical order.
Q 15 Write a python program to print Sandglass 3
pattern of star for given number n.
The sample example: For n=5, sandglass
pattern should look like :

*****
****
***
**
*
*
**
***
****
*****

Page 4 of 4

You might also like