Bank Incentive Policy Virtual programming lab

 A commercial bank has introduced an incentive policy of giving a bonus to all its deposit holders by the end of the year. The policy is as follows: A bonus of 2 percent of the balance held at the end of the year is given to everyone, irrespective of their balances, and 5 percent is given to female account holders if their balance is more than Rs.5000. Write a python program to calculate the balance at the beginning of the New Year.

INPUT:                                                      

Balance Rupees at the end of the year.

Gender (M/F)

OUTPUT:

Balance at the beginning of the year in rupees with two decimal places.

case=1

input=4000.50

F

output=4080.51

case=2

input=6000.23

M

output=6120.23

case=3

input=5050.50

F

output=5303.02

We want to verify the both cases with input and output.

Source Code:

bank_balance = float(input()) Gender = input() if Gender == 'F' and bank_balance>5000: print("{0:.2f}".format(bank_balance + bank_balance*5/100)) else: print("{0:.2f}".format(bank_balance + bank_balance*2/100))

OUTPUT:
4000.50
F
4080.51

6000.23 M 6120.23

5050.50 F 5303.02


Click on the "Try it Yourself" button to see how it works.

















Blog

Post a Comment

Previous Post Next Post