Computer Science, asked by ramlal2625, 1 year ago

Use your program to compute the cost of boiling water for a cup of coffee. Python

Answers

Answered by akashdalai
0

Ok , in my textbook I have written the textbook code, but substituted dollars, dimes, quarters and nickels, for their British money equivalents. Here is my code so far:

# Receive the amount amount = float(input("Enter the amount")) # convert the amount to pence remainingamount = int(amount * 100)

# find the number of two pounds numberOfTwoPounds = remainingAmount // 200 remainingAmount = remainingAmount % 200

# find the number of one pound numberOfOnePounds = remainingAmount // 100 remainingAmount = remainingAmount % 100

# find the number of fifty pence numberOfFiftyPence = remainingAmount // 50 remainingAmount = remainingAmount % 50

# find the number of twenty pence numberOfTwentyPence = remainingAmount // 20 remainingAmount = remainingAmount % 20

# find the number of ten pence numberOfTenPence = remainingAmount // 10 remainingAmount = remainingAmount % 10

# find the number of five pence numberOfFivePence = remainingAmount // 5 remainingAmount = remainingAmount % 5

# find the number of two pence in the remaining amount numberOfTwoPence = remainingAmount // 2 remainingAmount = remainingAmount % 2

Similar questions