<!-- This program is supposed to show employees who earn 10.75 an hour how much
ID: 3734677 • Letter: #
Question
<!--
This program is supposed to show employees who earn 10.75 an hour how much they will earn for working anywhere between 20 and 40 hours a week, but instead it says there's an undefined variable
<html>
<head>
<title>Wage Report</title>
</head>
<body>
<h1>WAGE REPORT</h1>
<?php
$hourlyWage == 10.75;
for ($hoursWorked = 20; $hoursWorked <= 40; $hoursWorked = $hoursWorked + 1)
{
$wage = $hoursWorked * $hourlyWage;
print ("If you work $hoursWorked hours, you will earn $$wage<br />");
}
?>
</body>
</html>
<--
Explanation / Answer
//if you have any query then comment below.please rate the answer
<html>
<head>
<title>Wage Report</title>
</head>
<body>
<h1>WAGE REPORT</h1>
<?php
$hourlyWage = 10.75;
for ($hoursWorked = 20; $hoursWorked <= 40; $hoursWorked = $hoursWorked + 1)
{
$wage = $hoursWorked * $hourlyWage;
print ("If you work $hoursWorked hours, you will earn $".$wage."<br />");
}
?>
</body>
</html>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.