p=int(input("Enter money: ฿ "))
n=int(input("Enter price: -฿ "))
x=p-n
print("Change is ฿",(x))
print("Bank 1000 =",(x//1000),('bill/bills'))
print("Bank 500 =",(x%1000//500),('bill/bills'))
print("Bank 100 =",(x%1000%500//100),('bill/bills'))
print("Bank 50 =",(x%1000%500%100//50),('bill/bills'))
print("Bank 20 =",(x%1000%500%100%50//20),('bill/bills'))
print("Coin 10 =",(x%1000%500%100%50%20//10),('coin/coins'))
print("Coin 5 =",(x%1000%500%100%50%20%10//5),('coin/coins'))
print("Coin 2 =",(x%1000%500%100%50%20%10%5//2),('coin/coins'))
print("Coin 1 =",(x%1000%500%100%50%20%10%5%2//1),('coin/coins'))
q=x//1000
w=x%1000//500
e=x%1000%500//100
r=x%1000%500%100//50
t=x%1000%500%100%50//20
y=x%1000%500%100%50%20//10
u=x%1000%500%100%50%20%10//5
i=x%1000%500%100%50%20%10%5//2
o=x%1000%500%100%50%20%10%5%2//1
l=q+w+e+r+t+y+u+i+o
print("all banks and coins =",(l))

Write Java from scratch.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.