9. Which language construct can best represent the following series of if conditionals?

<?php
if($a == a ) {
somefunction();
} else if ($a == b ) {
anotherfunction();
} else if ($a == c ) {
dosomething();
} else {
donothing();
}
?>


Вариант ответа 1 - A) A switch statement without a default case

Вариант ответа 2 - B) A recursive function call

Вариант ответа 3 - C) A while statement

Вариант ответа 4 - D) It is the only representation of this logic

Вариант ответа 5 - E) A switch statement using a default case


Комментарий: Because there is a catch-all else condition, a default case must also be provided for that situation. Answer E is correct.

Комментарии

Имя пользователяТекст комментарияВведите код