Sha256: 7548db7feab1b995c707acd81a40e8a7b00c4ffc21da43034a05f554966095b8

Contents?: true

Size: 898 Bytes

Versions: 5

Compression:

Stored size: 898 Bytes

Contents

=begin rdoc
  
Methods used in Chapter 2 (the Ruby Workbench)

=end

module RubyLabs
	
module IntroLab

=begin rdoc
  Compute the area of a 5-sided counter that is a square with a missing
  triangle shape.  The parameter +x+ is the length of one side of the square.
=end

# :begin :countertop 
  def countertop(x)
    square = x**2
    triangle = ((x/2)**2) / 2
    return square - triangle
  end
# :end :countertop

=begin rdoc
  Convert the temperature +f+ (in degrees Fahrenheit) into the equivalent
  temperature in degrees Celsius.
=end

  def celsius(f)
    (f - 32) * 5 / 9
  end

# :begin :fahrenheit
  def fahrenheit(c)
    # your expression goes here
  end
# :end :fahrenheit

# :begin :payment
  def payment(c)
    # your expression goes here
  end
# :end :payment

# :begin :payment
  def era(runs, ip)
    return (9.0 / ip) * runs
  end
# :end :payment

end # IntroLab

end # RubyLabs

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubylabs-0.9.0 lib/introlab.rb
rubylabs-0.8.3 lib/introlab.rb
rubylabs-0.8.2 lib/introlab.rb
rubylabs-0.8.1 lib/introlab.rb
rubylabs-0.8.0 lib/introlab.rb