click the green flag to start you cannot type a number higher than your budget or lower than one (so js type a number 1 - 500) i made this for school and bc im bored so this version is scuffed
i made this on smallbasic first: code: '-Design!- TextWindow.ForegroundColor = "purple" TextWindow.BackgroundColor = "pink" TextWindow.WriteLine("-----ATM MACHINE WITHDRAWAL-----") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") TextWindow.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") '-Variables!- bankbalance = 500 withdrawalmoney1 = 0 moremoney = 0 ' ~-Process-~ While (withdrawalmoney1 < 1 Or withdrawalmoney1 > bankbalance) TextWindow.WriteLine("You have P500 in your bank account.") TextWindow.WriteLine(" ") TextWindow.WriteLine("Withdraw money from your bank account: ") TextWindow.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") withdrawalmoney1 = TextWindow.ReadNumber() If (withdrawalmoney1 < 1 Or withdrawalmoney1 > bankbalance) Then TextWindow.WriteLine(" ") TextWindow.WriteLine("Invalid entry. Try again.") ElseIf (withdrawalmoney1 = bankbalance) Then TextWindow.WriteLine(" ") TextWindow.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") TextWindow.WriteLine("Thanks for stopping at the atm!") TextWindow.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") Program.End() EndIf EndWhile TextWindow.WriteLine(" ") TextWindow.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") TextWindow.WriteLine("You withdrew P" + withdrawalmoney1 + ", making you have P" + (bankbalance - withdrawalmoney1) + " left.") TextWindow.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") TextWindow.WriteLine(" ") ' More Money Withdrawals TextWindow.WriteLine("Type 1 to withdraw more money, otherwise, ") TextWindow.Write("press any other number to finish withdrawing: ") answer = TextWindow.ReadNumber() If answer = "1" Then 'Loop While (moremoney < 1 Or moremoney > bankbalance - withdrawalmoney1) TextWindow.WriteLine(" ") TextWindow.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") TextWindow.WriteLine("Please enter amount of money you would like to withdraw: ") moremoney = TextWindow.ReadNumber() TextWindow.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") If (moremoney < 1 Or moremoney > bankbalance - withdrawalmoney1) Then TextWindow.WriteLine(" ") TextWindow.WriteLine("Invalid entry. Try again.") ElseIf (withdrawalmoney1 = moremoney) Then TextWindow.WriteLine(" ") TextWindow.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") TextWindow.WriteLine("Thanks for stopping at the atm!") TextWindow.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") Program.End() EndIf EndWhile TextWindow.WriteLine("Your new balance is P" + (bankbalance - withdrawalmoney1 - moremoney) + ".") EndIf