39.0k views
5 votes
If $hourlyWage contains the value 10.00 and $hoursWorked contains the value 20, what value will $bonus contain after the following code is executed?

if ($hourlyWage >= 10 and $hoursWorked <= 20)
$bonus = $25.00;
else
$bonus = $50.00;

User Vdegenne
by
7.2k points

1 Answer

4 votes

Answer:

$25.00

Step-by-step explanation:

The variable $bonus will contain $25.00 because the if statement has the condition greater than or equals to for hourlyWage and less than or equals to for hoursWorked. Therefore the if condition evaluates to true since we are given in the question that;

$hourlyWage = 10.00 and $hoursWorked = 20

And the statement following the if is executed ignoring the else statement

User Fozia
by
8.0k points