Don't know why this is wrong


#1



https://www.codecademy.com/courses/ruby-beginner-en-32cN3/0/4?curriculum_id=5059f8619189a5000201fbcb#


(ruby):23: warning: else without rescue is useless


class Account 
attr_reader :name, :balance

def initialize(name, balance=100)
@name = name
@balance = balance
end

private 
def pin 
@pin = 1234 
end

private
def pin_error
"Access denied: incorrect PIN."
end
public 
def display_balance(pin_number)
   if  @pin_number == pin ?
       puts "Balance: $#{@balance}"
else 
    pin_error
end

end


#2

This is invalid syntax, the correct syntax for an if-else statement is

if condition
    #do something
else
    #do something else
end