This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

Andres
Andres presents ...

2010/6/29

Best Change Calculator

This is an expansion of my AP Computer Science summer project.

It calculates change.

I ended up having to round a lot of the doubles... which was my mistake in the first place. I probably should have used ints for all money values and then just divided once at the end. Either way, I think its accurate...

CONTROLS:

Click "TENDERED" and enter the amount of money you're "paying". (can enter cents too) Backspace to clear.

Click "ITEM PRICE" and enter the price of the item you're "paying for". (can enter cents too) Backspace to clear.

Click the "CHANGE:" block to calculate the best change combination of $.01, $.05, $.10, $.25, $1, $5, $10, $20, $50 and $100.

All programming by me, except for the BitFont class, which is made by Ninto.

4468 views / 8 in the last 7 days

1 vote | 0 in the last 7 days

Tags: simulation awesome with-source input

open in greenfoot
Your browser does not support the canvas tag.
A new version of this scenario was uploaded on Tue Jun 29 22:24:03 UTC 2010
AndresAndres

2010/6/30

To put it to the test... enter 0.00 for price and 181.41 for tendered ;)
Green-FootGreen-Foot

2010/7/2

Nice bro, I miss class haha it was to easy
AndresAndres

2010/7/3

Yeah same

Want to leave a comment? You must first log in.

Who likes this?

Green-Foot