Sunday, August 26, 2018

Find minimum number of currency notes and values that sum to given amount

Objective : This program will find the minimum number of currency notes and values that sum to given amount . 


UOH Student Protest For Chappati


Python Code1 :


def demonitisation(amount):
    notes=[2000,500,200,100,50,20,10,5,2,1]
  
    while amount>0:
        for i in range(0,len(notes)):
            if amount>=notes[i]:
                print("RS",notes[i]," , ",int(amount/notes[i])," Notes Requires")
                amount=amount%notes[i];
              
amount=int(input("Enter the amount :: "));

#invalid entry condition check
if(amount<0):
    print("Invalid Entry")
else:
    demonitisation(amount)


Python Code 2:


amount=int(input("Enter amount :: "));

print("==================")

if amount >= 2000:
    print("2000 ",int(amount/2000)," Rupee Note ");
    amount=amount%2000;
    
if amount >=500:
    print("500 ",int(amount/500)," Rupee Note");
    amount=amount%500;
   
if amount>=200:
    print("200 ",int(amount/200)," Rupee Note");
    amount=amount%200;
   
if amount>=100:
    print("100 ",int(amount/100)," Rupee Note");
    amount=amount%100;
   
if amount>=50:
    print("50 ",int(amount/50)," Rupee Note");
    amount=amount%50;
   
if amount>=20:
    print("20 ",int(amount/20)," Rupee Note")
    amount=amount%20;
   
if amount>=10:
    print("10 ",int(amount/10)," Rupee Note")
    amount=amount%10;
   
if amount>=5:
    print("5 ",int(amount/5)," Rupee Note")
    amount=amount%5;
   
if amount>=2:
    print("2 ",int(amount/2)," Rupee Note")
    amount=amount%2;

if amount>=1:
    print("1 ",amount," Rupee Note")
    

1 comment:

  1. Great blog. All posts have something to learn. Your work is very good and i appreciate you and hopping for some more informative posts.
    Azure DevOps Online Training
    Microsoft Azure DevOps Training Courses
    Microsoft Azure DevOps online Training in Hyderabad

    ReplyDelete

Behavior Recognition System Based on Convolutional Neural Network

Our this article is on this  research paper .  Credit : Bo YU What we will do ? We build a set of human behavior recognition syste...