Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

hi, I need help with PHP questions Please 4. Suppose you write a function that t

ID: 3877949 • Letter: H

Question

hi, I need help with PHP questions Please

4. Suppose you write a function that takes in a temperature in and returns one of the three strings "ice", "water", or "steam".

Give several inputs you might write tests for.

(if you want to consider the function as taking in temperatures in , that's fine too :-)

5. Suppose we are testing a function whose input can be any string. What are three different, representative inputs we might test?

(Your answer should start and end with quote-marks -- just like strings are written in source-code.)

Explanation / Answer

<?php

/* defining the function */

function testTemp(Double temp)

{

if(temp<=0)

echo"ice";

else if(temp>0 && temp<100)

echo "water";

else

echo "steam";

}

/*calling the function */

testTemp(34.56);

?>