This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: #dimes integer part of (change / .10) change change - (#dimes x .10) #nickels integer part of (change / .5) #pennies change - (#nickels x .5) 2. First Refinement a) get the number N b) compute N! c) display the result Second Refinement a) get the number N N number given by the user b) compute N! product 1 repeat for i=1, 2, 3, . .., N product product * i c) display the value of product Better Refinement a) get the number N N number given by the user b) compute N! product 1 i 1 repeat while i <= N product product * i i i + 1 c) display the value of product This version is better than the Second Refinement above because it doesn't include the ellipsis (i.e., . ..). The ellipsis leaves room for ambiguity and it not something that a computer understands....
View Full Document
This homework help was uploaded on 04/16/2008 for the course CSCI 1100 taught by Professor Hardwick during the Fall '08 term at Rensselaer Polytechnic Institute.
- Fall '08