Question: This is a PHP file. The first test for the number of 10 is working. But I want to add more cases such as negative

This is a PHP file. The first test for the number of 10 is working.

But I want to add more cases such as negative number, zero and character(a?b?c?), can you help me to fix it?

I have put the tester at the bottom, now i am trying to figure how to write in the primeFucntion in order to pass those tests. please help me! Thank you!!

This is a PHP file. The first test for the number of

function primeFunction($input){

$num = 2; $result="";

while ($num

if($count

function tester($actual, $expect){ if (strcmp($actual, $expect) == 0 ){ echo " Test passed "; } else{ echo " Test not passed "; }

}

tester(primeFunction(10),"2 3 5 7 "); tester(primeFunction(-10),"negative number is invalid"); tester(primeFunction(0),"zero is invalid"); tester(primeFunction(a),"please enter number");

?>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!