DevPinoy.org
A Filipino Developers Community
   

Project: Vendo

rated by 0 users
This post has 11 Replies | 2 Followers

Top 25 Contributor
Posts 193
Points 3,315
jop Posted: 11-22-2007 7:39 PM

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]

Top 10 Contributor
Posts 1,105
Points 18,350

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

  • | Post Points: 20
Top 25 Contributor
Posts 193
Points 3,315
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

[jop]

  • | Post Points: 20
Top 25 Contributor
Posts 106
Points 1,635

2. Boy bought a PSP Slim for 8400 pesos. He gave the machine 9000 pesos. The machine returned six 500-peso bills as change.

 

How would you differentiate 100 to 500 peso bill? 

Dwarvend's Review

  • | Post Points: 35
Top 10 Contributor
Posts 1,037
Points 23,995

pre matagal nang walang storck ngayon...na rebrand na into "Starr" he he Stick out tongue matagal ka na yatang wala sa pinas jop ah

http://devpinoy.org/blogs/cruizer
Naglalayong buksan at palayain ang kamalayan ng Pinoy .NET developer
  • | Post Points: 35
Top 10 Contributor
Posts 2,038
Points 42,060

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

Big Smile

devpinoy sig

  • | Post Points: 20
Top 25 Contributor
Posts 193
Points 3,315

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.

[jop]

  • | Post Points: 5
Top 25 Contributor
Posts 193
Points 3,315

cruizer:

pre matagal nang walang storck ngayon...na rebrand na into "Starr" he he Stick out tongue matagal ka na yatang wala sa pinas jop ah

Hindi pa naman gaanong katagalan.. Hindi lang talaga ako bumibili ng candy.

[jop]

  • | Post Points: 5
Top 25 Contributor
Posts 193
Points 3,315

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?

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?

[jop]

  • | Post Points: 20
Top 10 Contributor
Posts 1,037
Points 23,995

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 Stick out tongue

http://devpinoy.org/blogs/cruizer
Naglalayong buksan at palayain ang kamalayan ng Pinoy .NET developer
  • | Post Points: 20
Top 10 Contributor
Posts 1,105
Points 18,350

ayoko na, lumalaki scope, tsk tsk tsk

  • | Post Points: 20
Top 25 Contributor
Posts 193
Points 3,315
jokiz:

ayoko na, lumalaki scope, tsk tsk tsk

Pwede namang gumawa na lang ng version 0.1 eh. Hindi naman kailangang manghingi pa ng additional requirements.

[jop]

  • | Post Points: 5
Page 1 of 1 (12 items) | RSS
Copyright DevPinoy 2005-2008