1
$\begingroup$

Can anyone confirm to me what this function calculates?

Function m(t); p=9t; q=p+32; r = q/5; Return r; End function 

Ok so inputting numbers from $0-9$ (in numerical order) the output is as follows: $$6.4, 8.2, 10, 11.8, 13.6, 15.4, 17.2, 19, 20.8, 22.6 $$ Ok so clearly each value is being incremented by $1.8$. But would it be correct to say that the function adds increments by $1.8$?

  • 1
    Please be consistent between lower and upper case. If you divide by 5 before adding 32 you get the conversion from Celsius to Fahrenheit.2012-11-03
  • 0
    Sorry about the format. Yes I get the conversion for Celsius into Fahrenheit. This is why i am confused when i am being asked what this code calculates.2012-11-03
  • 0
    When the 32 is divided by 5, it takes Celsius and returns Fahrenheit-25.6. I don't think there is a better characterization than Alexander Gruber has given.2012-11-03

4 Answers 4