Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <!--I run an investment company that pays 10% per month compounding interest on any amount I invest
  2. Write a PHP program that breaks down my earnings per month for a 2year period and what my total pay package will be after 2years
  3. Lay out all your result in a nicely formmatted HTML table -->
  4.  
  5. <html>
  6. <head><title>Hulk Investment</title></head>
  7. <body>
  8. <table border="1">
  9. <tr bgcolor="grey">
  10. <th>Month</th>
  11. <th>Earnings</th>
  12. <th> Net Balance</th>
  13. </tr>
  14.  
  15. <?php
  16. $amount = $_POST['amount'];
  17.  
  18. for ( $x = 1; $x <= 24 ; $x++){
  19. $earnings = ($amount * 0.1 );
  20. $total = $earnings + $amount;
  21. echo '<tr><td>'.$x.'</td>';
  22. echo '<td>'.number_format($earnings,2) .'</td>';
  23. echo '<td>'. number_format($total,2). '</td></tr>';
  24. $amount = $total;
  25. }
  26. ?>
  27. </table>
  28. </body>
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement