Python- IF(2)

Hello Students!!


IMPORTANT!! 

Please read carefully

*We at St Columba's School, are ready to take the next step - and move towards using Google Classroom as a tool to enhance the teaching learning environment.

*This shift involves the school giving each student a unique email address, which he will need to setup ( the teachers will assist him in doing the same). This email will facilitate each student to interact with his teachers.

* The student should use this email ID only for:

-interacting with  teachers on school /subject related matters
-keep the words and expressions as he would- if he  were interacting with us as a Columban student
-use the facilities connected to this email ID only for google meets organised with the permission of a teacher 
-he should have a copy of the permission given ( when and by which teacher and for what purpose)
-do not access any of the other facilities connected with this email address unless he first seeks the permission of a teacher
(He should have a copy of the permission given - when and by which teacher and for what purpose).

*Please note that Google and St Columba's have legal obligations by giving you access to this email address and hence,
you will need to sign an agreement when creating this email ID. 


*Be informed that the history of use of this ID shall have a digital footprint !

----------------------------------------------------------------------------
 Google meet class  link today is:


----------------------------------------------------------------------------
As we have stepped into our practical classes, it is really important for you to keep practicing on Python. 

In the last blog I gave you two questions to practice on IF Condition. 

Please verify your answers from the following solutions: 


►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►

Q1. Write a program in python to accept the fees of a student and her/his percentage in the exams. If the percentage is higher than 75 then reduce the fees by Rs. 500 and print the new fees on the screen, otherwise reduce the fees by Rs. 200 and print the new fees. 

Ans. 

Fees = float(input("Please enter your fees : "))
Per = float(input("Enter your Percentage : "))

if ( Per > 75 ):
       Discount = 500
else:
       Discount = 200

NF = Fees - Discount
print("Your new fees is : ", NF)

Let's see it's output in both the cases: 


Let's analyse:

In first case, percentage was 78, i.e. more than 75, therefore Rs. 500 were deducted from the Fees.

In second case, percentage was 72, i.e. less than 75, therefore Rs. 200 were deducted from the Fees.
►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►

Q2. Write a program to accept the RATE and QUANTITY of a product. 
Then show the following:- 
(A) Amount (i.e. Rate X Quantity)
(B) Net amount after deducting the discount on the following basis:
  • If the Amount is more than 5000 then give discount at the rate of 20% of Amount
  • Otherwise give discount at the rate of 10% of Amount.
Ans. 

Qty = float(input("Enter the quantity of a product : "))
Rate = float(input("Enter the Rate of the product : "))

Amt = Qty * Rate

if (Amt > 5000):
       Dis = 20
else:
       Dis = 10

Discount = (Amt * Dis) / 100
NA = Amt - Discount

print("Total Amount is  : ", Amt)
print("Less: Discount    : ", Discount)
print("Net Amount        : ", NA)

Let's see it's output in both the cases: 

Let's analyse:

In first case, Amount was 25000, i.e. more than 5000, therefore Rs. 5000 (i.e. 20% of 25000) is deducted from the Amount as Discount 

In second case, Amount was 2000, i.e. less than 5000, therefore Rs. 200 (i.e. 10% of 2000) is deducted from the Amount as Discount 
►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►


All right...

Now let us do some programing. 

This is classwork, and you are expected to submit it during this period only. 


I hope you remember the SIMPLE INTEREST program done in class-9. This time there's a small twist in it.

Let's do it...




►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►
►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►

That's all for today...

Kindly note the following questions as your homework exercise:

Q1. Write a program to accept the number of units produced by a labour in a factory. Then calculate the amount to be paid to the labour on the following basis: 

A)  If a person has produced more than 500 units then she/he should be paid @ Rs. 10 per unit. 

B)  Otherwise she/he should be paid @ Rs. 8 per unit. 
===========================================
Q2. In a hostel, operated by a state government, the room rent is charged as follows: 

A)  Boys - Rs. 50 per day

B)  Girls - Rs. 48 per day

You are required to develop a program in python that can help in calculating the total rent to be paid by a student for the number of days she/he has used the hostel room. 


►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►►


Thank you

God Bless You

Computer Science Department
(Middle School)

Comments

Post a Comment

Popular posts from this blog

Python-IF(Prac)

Python-IF command

Python- relational operators