<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
<In what way does your code behave incorrectly? Include ALL error messages.>
```class Account
attr_reader :name, :balance
def initialize(name,balance=100)
@name=name
@balance=balance
end
private
def pin
@pin=1234
end
def pin_error
return “Access denied: incorrect PIN.”
end
public
def deposit(pin_number,amount)
if pin_number==pin
@balance+=amount
puts"Deposit #{amount}.New balance:$#{@balance}."
else pin_error
end
end
def display_balance(pin_number)
if pin_number==pin
puts "Balance:$#{@balance}."
else pin_error
end
end
def withdraw(pin_number,amount)
@balance-=amount
if pin_number==pin
if @balance>0
puts"Withdrew #{amount}.New balance:#{@balance}."
else
puts"You art trying withdrew #{amount},not sufficient fund.New balance:#{@balance}."
end
else puts pin_error
end
end
def get_pin
puts @pin
end
end
checking_account=Account.new(“Armen”,1000)
checking_account.withdraw(1234,900)
checking_account.display_balance(1234)
checking_account.get_pin
checking_account.deposit(1234,188)
checking_account.withdraw(1234,38)
checking_account.withdraw(1234,500)
checking_account.withdraw(1244,38)
please any suggestion,correction,optimization are welcomed. I just wondering is it possible in withdraw method instead if …else use other kind conditional structures. Share with me your thoughts.
<do not remove the three backticks above>