Calculator
Lesson 19Author : 🦒
Last Updated : November, 2017
Code
puts "num1: "
num1 = gets.chomp.to_f
puts "Enter Operator: "
op = gets.chomp
puts "num2: "
num2 = gets.chomp.to_f
if op == "+"
puts num1 + num2
elsif op == "-"
puts num1 - num2
elsif op == "/"
puts num1 / num2
elsif op == "*"
puts num1 * num2
else
puts "Invalid Operator"
end