Think of the calculation program completed in week2. What if you wanted to show what the teacher discount amount would be for 5%, 10%, 15%, 20%, and 25%. Write a loop program for the calculated program in week2 to show the teacher discount amount for the different percentages listed above. Below, you will see the sample program from week2. Your program should include: • Variables for each part of problem. See example below: Eg. $apple = 10, $orange = 15, $discount = 0.2 <!DOCTYPE html> <html> <body> <?php $apple = 10; $orange = 15; $discount = 0.2; $subtot = $apple + $orange; echo "Your total before the 20% discount is: "; echo $subtot; $caldiscount = ($apple + $orange) * $discount; $tot = ($apple + $orange) - $caldiscount; echo "<br>Your total after the discount is: "; echo $tot; ?> </body> </html>
Think of the calculation program completed in week2. What if you wanted to show what the teacher discount amount would be for 5%, 10%, 15%, 20%, and 25%. Write a loop program for the calculated program in week2 to show the teacher discount amount for the different percentages listed above.
Below, you will see the sample program from week2.
Your program should include:
Eg. $apple = 10, $orange = 15, $discount = 0.2
<!DOCTYPE html>
<html>
<body>
<?php
$apple = 10;
$orange = 15;
$discount = 0.2;
$subtot = $apple + $orange;
echo "Your total before the 20% discount is: ";
echo $subtot;
$caldiscount = ($apple + $orange) * $discount;
$tot = ($apple + $orange) - $caldiscount;
echo "<br>Your total after the discount is: ";
echo $tot;
?>
</body>
</html>
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images