46.0k views
3 votes
How many combinations of pennies, nickels, and/or dimes are there with a total value of 35 cents?

User Maegan
by
3.3k points

2 Answers

1 vote

Hello,

there are 20 combinations making a total of 35 cents

In qb64

Dim p As Integer, n As Integer, d As Integer, s As Integer, nb As Integer

nb = 0

For p = 0 To 35

For n = 0 To 7

s = 1 * p + 5 * n

If s < 36 Then

For d = 0 To 3

s = p + 5 * n + d * 10

If s = 35 Then

nb = nb + 1

Print nb, p; n; d

End If

Next d

End If

Next n

Next p

End

How many combinations of pennies, nickels, and/or dimes are there with a total value-example-1
User Igor Vasiliev
by
3.3k points
3 votes

Answer:

3 dimes 1 nickel

Explanation:

1 dime = 10 cents

3×1 dime = 30 cents

1 nickel = 5 cents

3 dimes + 1 nickel

= 30 cents + 5 cents

= 35 cents

User Artouiros
by
3.4k points