Skip to content

Commit

Permalink
Merged.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuki Okubo authored and Yuki Okubo committed Jun 23, 2012
2 parents 5c97fe0 + c49c585 commit 121b8ef
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions calc.rb
@@ -1,12 +1,12 @@
case ARGV[3]
when '+'
p ARGV[0], ARGV[1], ARGV[3]
p plus(ARGV[1].to_i, ARGV[2].to_i)
when '-'
p ARGV[0], ARGV[1], ARGV[3]
p minus(ARGV[1].to_i, ARGV[2].to_i)
when '*'
p ARGV[0], ARGV[1], ARGV[3]
p (ARGV[1].to_i, ARGV[2].to_i)
when '/'
div(ARGV[1], ARGV[3])
p div(ARGV[1].to_i, ARGV[2].to_i)
else
exit
end
Expand All @@ -15,4 +15,7 @@ def div( op1, op2 )
return op1/op2
end

p div(10,4)
def plus( operand1, operand2 )
result = operand1 + operand2
return result
end

0 comments on commit 121b8ef

Please sign in to comment.