Skip to content

Q2A Nether

Menu
  • Q2ANSWER Archive
  • Home
  • News
  • Categories
  • About
  • Contact
Menu

Create the logic for a program that continuously prompts the user for a number of dollars until the user enters 0. Pass each entered amount to a conversion method that displays a breakdown of the passed amount into the fewest bills; in other words, the method calculates the number of 20’s, 10’s, 5’s and 1’s as needed

Posted on October 20, 2022 by admin

Create the logic for a program that continually prompts the user for a certain number of dollars until the user enters 0. Pass each amount entered to a conversion method that displays a breakdown of the amount passed into the least of invoices; in other words, the method calculates the number of 20, 10, 5 and 1 as dollars needed = 1

loop while dollars > 0

bills = breakdown (dollars)

end loop

breakdown(n)

twenties = int(n/20)

n -= twenties

tens = int(n/10)

n -= tens

five = int(n/5)

n -= five

ones = n

back (twenty, tens, five, ones) oops. The stages of decomposition must be

n -= twenties*20

and so on for the other invoices.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Een ….. vangt geen vliegen (5)?
  • Hierin maken we een minder waterige jus d’orange. (13) letters (crypt.?
  • VREEMD HOOR DAT HET THEMA GELDT ZOLANG HET DUURT?
  • ONGEACHT 7 LETTERS – Puzzelwoorden?
  • GLANS 5 LETTERS – Puzzelwoorden?

LOREM IPSUM

Sed ut perspiciatis unde omnis iste natus voluptatem fringilla tempor dignissim at, pretium et arcu. Sed ut perspiciatis unde omnis iste tempor dignissim at, pretium et arcu natus voluptatem fringilla.

LOREM IPSUM

Sed ut perspiciatis unde omnis iste natus voluptatem fringilla tempor dignissim at, pretium et arcu. Sed ut perspiciatis unde omnis iste tempor dignissim at, pretium et arcu natus voluptatem fringilla.

LOREM IPSUM

Sed ut perspiciatis unde omnis iste natus voluptatem fringilla tempor dignissim at, pretium et arcu. Sed ut perspiciatis unde omnis iste tempor dignissim at, pretium et arcu natus voluptatem fringilla.

©2026 Q2A Nether | Design: Newspaperly WordPress Theme