Skip to content

Commit

Permalink
Initial foundation for bank application
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeblake committed Apr 7, 2014
1 parent 8376ff7 commit 5b4bd89
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions ruby-scripts/bank.rb
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
##objects and classes and object oriented programming
##non object oriented programming you would type your data in a series

class BankAccount

def initialize(name)
@transactions = []
@balance = 50

end
@balance = 0
end

def deposit
print "How much would you like to deposit? "
puts "How much would you like to deposit?"
amount = gets.chomp
@balance += .to_f
@balance + amount
puts "$ #{amount} deposited"
@balance += amount.to_f
puts "$#{amount} has been deposited."
end

def show_balance
puts "Your Current balance is #{@balance}"
puts "Your current balance is #{@balance}"
end
end

bank_account = BankAccount.new('Blake Jackovitch')
bank_account.class
bank_account = BankAccount.new("Chocolate Tomato")
bank_account.class

bank_account.deposit
bank_account.show_balance
bank_account.deposit
bank_account.show_balance

0 comments on commit 5b4bd89

Please sign in to comment.