Sha256: ed175c84c72669ee24f854f5b67a09f2b3f4d549b71326ebb9983d985870b157

Contents?: true

Size: 1.25 KB

Versions: 1

Compression:

Stored size: 1.25 KB

Contents

 
 
class Sandboxcalc

  def frwdadd 
	  $stderr.puts "in frwdadd"
    
    @fresult = "%s + %s = %s" % [@a_fcalc, @b_fcalc, @a_fcalc.to_f+@b_fcalc.to_f]
    
    $frunningtotal += @fresult + "\n"
    
    @frunningtape = $frunningtotal
    @a_fcalc = "%s" % [@a_fcalc.to_f+@b_fcalc.to_f] 
  end
	

  def frwdsubtract
    @fresult = "%s - %s = %s" % [@a_fcalc, @b_fcalc, @a_fcalc.to_f-@b_fcalc.to_f]
    
    $frunningtotal += @fresult + "\n"
    
    @frunningtape = $frunningtotal
    @a_fcalc = "%s" % [@a_fcalc.to_f-@b_fcalc.to_f] 
  end
	

  def frwdmultiply
    @fresult = "%s * %s = %s" % [@a_fcalc, @b_fcalc, @a_fcalc.to_f*@b_fcalc.to_f]
    
    $frunningtotal += @fresult + "\n"
    
    @frunningtape = $frunningtotal
    @a_fcalc = "%s" % [@a_fcalc.to_f*@b_fcalc.to_f] 
  end
	

  def frwddivide
    @fresult = "%s / %s = %s" % [@a_fcalc, @b_fcalc, @a_fcalc.to_f/@b_fcalc.to_f]
    
    $frunningtotal += @fresult + "\n"
    
    @frunningtape = $frunningtotal
    @a_fcalc = "%s" % [@a_fcalc.to_f/@b_fcalc.to_f] 
  end
	

  def frwdcleartape
    $stderr.puts "in clear tape"
    
    $frunningtotal = " "
    
    @frunningtape = $frunningtotal
  end
	
end

$testcalc = Sandboxcalc.new
 # intialize variables

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tinkerbell-0.03 code/superant.com.sandbox/tabthree.rb