You have been hired to write a program that calculates change for some generic vending machine. Here are the user stories:
1. Alex bought an iPod shuffle for 4k pesos. He gave the machine the exact amount. The machine did not return any change.
2. Boy bought a PSP Slim for 8400 pesos. He gave the machine 9000 pesos. The machine returned six 500-peso bills as change.
3. Cathy bought a bikini for herself. It costs 1576 pesos. She gave 1600 pesos to the machine. She is expecting one 20-peso bill and four 1-peso coins. Apparently, the machine does not have enough bills and coins. She got four 5-peso coins, two one-peso coins, eight 25-cent coins.
4. Derek bought a can of coke worth 28 pesos. He gave the machine 30 pesos. The program noticed that it's running low on 1-peso coins, so instead of returning two 1-peso coins, it gave out forty 5-cent coins, and a small plastic bag to hold the coins.
5. Eric bought some condoms. He should have gotten a two-peso change but the machine does not have enough money. The machine gave him cherry balls instead.
I'm going to act as the customer/client for this mini-project so I'll be expecting questions from you. :D
[jop]
so when will the machine use this low running coin? assuming that it's now both running out of 1-peso and 5-cent, i'm assuming that it will use 1-peso in that case since 5-cent is more important for other transactions? do all value coin have the same quantity threshold before it's classified as running low?
how much is a cherry ball? and lastly, when do you expect this project to be completed? ;p
↑ Grab this Headline Animator
jokiz:so when will the machine use this low running coin? assuming that it's now both running out of 1-peso and 5-cent, i'm assuming that it will use 1-peso in that case since 5-cent is more important for other transactions? do all value coin have the same quantity threshold before it's classified as running low? how much is a cherry ball? and lastly, when do you expect this project to be completed? ;p
Good question - which means I don't know a good answer for it. Make the threshold adjustable perhaps? Worst case would be to set the threshold to 0 which disables the low running functionality. Or make a program determine what a good threshold is based on previous runs?
I remember cherry balls to be about 5 cents a piece. If there is no cherry ball, then mentos, stork or halls will do (tatlong mentos == 2 pesos).
Complete? I don't know. I think this will be an evolving project. We might have additional requirements in the future. We will be able to see how many iterations your code can survive. :D
How would you differentiate 100 to 500 peso bill?
pre matagal nang walang storck ngayon...na rebrand na into "Starr" he he matagal ka na yatang wala sa pinas jop ah
Can you clarify this jop? What monetary values are we allowed to use in the in the vendo machine(100s, 200s, 500s, 1s, 2s, 5s, 1000s)? Also, can we set a limit on the cash on each stack? say:
P100 = 100 pcs
P500 = 50pcs
P200 = 70pcs
Dwarvend: How would you differentiate 100 to 500 peso bill?
Kung input ng bills, may sensor na sigurong nagbabasa nun.
Kung output ng bills, each bill type has it's own separate tray.
cruizer: pre matagal nang walang storck ngayon...na rebrand na into "Starr" he he matagal ka na yatang wala sa pinas jop ah
Hindi pa naman gaanong katagalan.. Hindi lang talaga ako bumibili ng candy.
keithrull: Can you clarify this jop? What monetary values are we allowed to use in the in the vendo machine(100s, 200s, 500s, 1s, 2s, 5s, 1000s)? Also, can we set a limit on the cash on each stack?
Can you clarify this jop? What monetary values are we allowed to use in the in the vendo machine(100s, 200s, 500s, 1s, 2s, 5s, 1000s)? Also, can we set a limit on the cash on each stack?
Sure.
We'll allow all denominations. We even allow candies to be used as change, so that's another "denomination".
We'll have a limit on the stack but shouldn't that be a limitation of the hardware (space on the machine itself) instead of the software?
master jop, may special case ba for Brunei and Singapore? kasi di ba interchangeable yun currency nila, so pwede gamitin for example yun 10 Brunei ringgit currency sa Singapore at S$10 din ang value, and vice-versa. he he
ayoko na, lumalaki scope, tsk tsk tsk
jokiz:ayoko na, lumalaki scope, tsk tsk tsk