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
Related Q & A:
- When I click on my Internet explorer, It logs me automatically into yahoo, How do I change this?Best solution by Yahoo! Answers
- How to get my address book to open an e-mail when I click on address?Best solution by Yahoo! Answers
- When I click on the YIM icon at Yahoo.com, I am sent to the download page, instead of YIM already loaded. Why?Best solution by Yahoo! Answers
- How can I stop a player in chess from freezing my game when I am winning in the middle or at the end of a game?Best solution by chess.com
- Where can I go to create a quote?Best solution by brainyquote.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.