forked from Ada-C6/BankAccounts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram.rb
More file actions
76 lines (62 loc) · 1.96 KB
/
Copy pathprogram.rb
File metadata and controls
76 lines (62 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# file 2/2 for Wave 2
require_relative 'account'
require_relative 'checking_account'
require_relative 'savings_account'
# puts "WAVE 2"
# puts "________________"
# # PRINTED self.all method!
# Bank::Account.all.each do |line|
# puts line
# end
#
# # EXAMPLE OF self.find method!
# puts "id: 1213 #{Bank::Account.find(1213)}"
puts "WAVE 3" # You may need to comment out the information for wave 2 to get this section to work.
puts "________________"
s = Bank::SavingsAccount.new(13774, 100000, "01/02/1903")
c = Bank::CheckingAccount.new(13774, 1000, "01/02/1903")
puts "SAVINGS ACCOUNT"
puts s.welcome
puts s.withdraw(500)
puts s.deposit(10)
puts s.deposit(10)
puts s.deposit(10)
puts s.withdraw(473)
puts "CHECKING ACCOUNT"
puts c.withdraw(5)
puts c.deposit(15)
puts c.deposit(15)
puts c.deposit(15)
puts c.withdraw_using_check(10)
puts c.withdraw_using_check(10)
puts c.withdraw_using_check(10)
puts c.withdraw_using_check(5)
puts c.reset_checks
puts c.withdraw_using_check(10)
# Playing with the information to allow for deposit, withdrawal, and balance. I know this would be better off in the account.rb file but everytime I put it there as a method, it recieves many many errors.
# puts "What can I help you with today? Please select an option below by selecting the letter of the desired action."
# puts "(a) provide balance"
# puts "(b) withdraw cash"
# puts "(c) deposit money into account"
# action = gets.chomp
#
# until action == "quit"
# if action == "a"
# puts line[1]
# puts Bank::Account.all[i][1]
# puts Bank::Account.all[i].balance
# elsif action == "b"
# puts "You chose to withdraw cash"
# user.withdrawal
# elsif action == "c"
# user.deposit
# else
# puts "You did not chose a or b"
# end
# puts "Can I help you with anything else? If not please enter 'quit' otherwise select options a,b, or c."
# action = gets.chomp
# end
# end
# end
#
# exit