question archive Write, test, and debug (if necessary) a Ruby program with the following specification: Input: Three numbers, a, b, and c, each on its own line, from the keyboard
Subject:Computer SciencePrice:2.89 Bought3
Write, test, and debug (if necessary) a Ruby program with the following specification:
Input: Three numbers, a, b, and c, each on its own line, from the keyboard.
Output: The value of the expression 10ab-((c-1)/17.44).
# e151.rb - A solution to Exercise 15.1
# Get input
puts "Please type the three input numbers"
a = gets.to_i
b = gets.to_i
c = gets.to_i
# Compute result
result = 10 * a * b - ((c - 1) / 17.44)
# Display the result
puts "The result is: #{result}"