Beamer397 Posted November 20, 2015 Report Share Posted November 20, 2015 I was given this problem to simulate a vending machine and to add the total cost and total money input and have it calculate out the change due or more money needed. I have set it up to calculate the total cost and input values but it then asks to use the select function (true false) to compute the change due or change needed and im not sure how to wire the select function into it. Quote Link to comment
eberaud Posted November 20, 2015 Report Share Posted November 20, 2015 They probably want you to compare total cost and the total input. Use a "greater or equal to" function which will generate a Boolean and wire this Boolean to the Select input: If Input >= Cost then Change Due = Input - Cost and Additional Money Needed = 0 If Input < Cost then Change Due = 0 and Additional Money Needed = Cost - Input Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.