How to populate listbox with textbox?

I have to create a program using one textbox and one listbox. When I click the textbox, all possible ways that ten dollars can be formed using pennies, nickles, dimes and quarters must be displayed inside the listbox. Anyone have any i

  • Answer:

    Which language(s)? Here's some psuedocode: total = 0 for q in range(10/.25): ...print q + " quarters" ...total = q * .25 ...for d in range((10-total)/.1): ......print d + " dimes" ......total = total + d * .1 ......for n in range((10-total)/.05): .........print n + " nickels" .........total = total + n * .05 .........print (10-total)/.01 + " pennies" Periods added for indentation because AB doesn't support tabs. Here's how this works: Iteration 1: q = 0, total = 0, "0 quarters" d = 0, total = 0, "0 dimes" n = 0, total = 0, "0 nickels" (10-0)/.01 = 1000; "1000 pennies" Iteration 2: q = 0, total = 0, "0 quarters" d = 0, total = 0, "0 dimes" n = 1, total = .05, "1 nickels" (10-.05)/.01 = 995; "995 pennies" etc.

tom1020 at Answerbag.com Visit the source

Was this solution helpful to you?

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.