+ 1
Could anyone tell me what's wrong with my program of iteration and method??
I want to make following 2 things. But they didn't work... I hope someone could teach me what's wrong. âWhat I wanna make. 1. Method that can calculate Celsius from Fahrenheit. 2. Output of each calculation of method above when I put numbers from 1 to 100 in this method. âMy trial 1. Method def fahr_to_cels(fahr) cels = (fahr - 32) * 5 / 9 end 2. Output all_fahr = [1..100] all_fahr.each do |x| p fahr_to_cels(x) end thank you so much! Sorry for my poor English.
1 Answer
+ 1
Thank u so much!! I was confused with range and array đ