PAGE 35 6.2 A Few Things to Try

1. Angry boss program

puts 'What do you want!?'
want = gets.chomp
puts 'WHADDYA MEAN "I WANT ' + want.upcase + '" ?!? YOU\'RE FIRED'



2. Program to display a table of contents.

page_width = 60
puts ('Table of Contents'.center(page_width))
puts ''
puts ('Chapter 1: Getting Started'.ljust(page_width/2) + 'page 1'.rjust(page_width/2))
puts ('Chapter 2: Numbers'.ljust(page_width/2) + 'page 9'.rjust(page_width/2))
puts ('Chapter 3: Letters'.ljust(page_width/2) + 'page 13'.rjust(page_width/2))