I am an OpenEdge (aka Progress) developer that loves clean code and good looking applications that are easy to use. My main pet project is the Progress DataDigger
FUNCTION solve RETURNS INTEGER (amount AS INTEGER):
DEFINE VARIABLE bill AS INTEGER EXTENT 6 INITIAL [500,200,100,50,20,10] NO-UNDO.
DEFINE VARIABLE needed AS INTEGER NO-UNDO.
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DO i = 1 TO EXTENT(bill):
needed = needed + TRUNCATE(amount / bill[i],0).
amount = amount - (bill[i] * TRUNCATE(amount / bill[i],0)).
END.
RETURN needed.
END FUNCTION.
MESSAGE
solve(1250) SKIP
solve(1500)
VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Progress 4GL solution: