Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

tapfu Group Title

Write a program to simulate a vending machine and calculate change based on the amount paid. Given the cost, the user should first be prompted to add more money until the cost is met/exceeded by the payment. Assume that all change is given in coins only and coins come in the following denominations: R5, R2, R1, 50c, 20c, 10c, 5c

  • one year ago
  • one year ago

  • This Question is Open
  1. larrymud Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    This is a classic State Machine problem. Use the total deposited as the state. Use transition events like vend, addcoin and cancel. Many State Machine examples can be found online a good example for this problem is here: http://www.gamedev.net/blog/802/entry-2217738-system-design----finite-state-machines/

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...


  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.