Desperately need help with a project -
12-07-2011, 05:36 PM
Here's the deal. I have a project that's due next Wednesday. I'll post a copy of the world so people can see what I'm working with. The basis of the assignment is that I need to create a small program in which a rabbit tries to withdrawl money from an ATM in the side of a tree using variables, such as reporting a balance, depositing and withdrawing from and having those respective changes reported. (The ONLY I really know is that the rabbit is supposed to contain the variable to display the balance, and that withdrawls are not supposed to be allowed if the balance is 0.) I've figured out a few very basic things, but I'm very new to alice, and this assignment, while probably very simple, is killing me. I am not asking for someone to do my homework for me.
I just need someone to point me in the right direction, or maybe give me some examples. Please help, because I'm not getting very much in school...
Here's my take on it. Lots of cool stuff added, but not quite done. It still doesn't tell the user when they've withdrawn too much or deposited too little.
Deposits and Withdrawals... -
12-13-2011, 01:58 PM
Well, I am a noob, too, so if my advice is flawed, hopefully someone else will point out any said flaws.
What I do know is that you will need number variables for deposits, withdrawals, and balance. It would probably be a good idea to have separate methods for each. Create an event for each of these - so that when the user clicks on the words: balance, withdrawal or deposit, that method will be called.
Like GameKid wrote, you will need to use a world function to ask the player questions: yes/no, number or string (letter(s), words, etc).
I added some code to your project to ask the user how much they would like to withdraw when they click the text "Withdraw" and then print the answer - with a pretty long explanation of how I did it, so you can understand what GameKid was talking about a bit better.