- echoinput.rb: echo standard input
to standard output (with line numbers); type
ruby echoinput.rb < echoinput.rb
at the command prompt (after installing Ruby) to display the program.
- sum.rb: compute sum of entered
numbers. Enter
ruby sum.rb
5
4
3
Control-Z
(where the last line is holding down the control key and pressing a Z)
to print a 12.
- gpa.rb: compute GPA
- phones.rb: simple phone book based on
arrays; to test, run irb and type
irb> load 'phones.rb'
irb> test_phone_book
- revised-phones.rb: revised
phone book using hash tables.