Ask Question
19 September, 07:02

What does $message contain after the following code executes?

$age = 19;

$score = 750;

if ($age > = 21 && $score > = 700) {

$message = 'Loan approved';

} else if ($age > = 21 && $score > = 650) {

$message = 'Cosigner needed.';

} else if ($age > = 18 && $score > = 680) {

$message = 'Two cosigners needed.';

} else {

$message = 'Loan denied.';

}

a. Loan approved.

b. Cosigner needed.

c. Two cosigners needed.

d. Load denied.

+2
Answers (1)
  1. 19 September, 07:12
    0
    c. Two cosigners needed.

    Explanation:

    In the first if condition,

    if ($age > = 21 && $score > = 700)

    The age variable is set to 19, which is not >=21, so this condition is false.

    In the second condition,

    else if ($age > = 21 && $score > = 650)

    Same story, age variable is equal to 19, which is not >=21, this condition is also false.

    In the third condition,

    else if ($age > = 18 && $score > = 680)

    age condition is true because 19 is >=18, and score condition is also true, because 750 is >=680. So this condition is true.

    Henceforth, variable message will contain the string "Two cosigners needed."
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What does $message contain after the following code executes? $age = 19; $score = 750; if ($age > = 21 && $score > = 700) { $message = ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers