puts "Hello! Reading temperature value from data file..."
num = File.read("temp.dat")
puts "The number is #{num}..."
celsius = num.to_i
fahrenheit = (celsius.to_i * 9 / 5) + 32
puts "The Fahrenheit value is: #{ fahrenheit }."
In the third line, the ... after the #{num} block are printed in a new line. I was under the impression that using that block was passing parameter to the display allowing easier formatting.
Why are the dots going to a new line?
When you read in a file, you get the newlines, too. Maybe what you’re looking for is this:
If you have a look at what you’re reading it might make sense: