Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--I run an investment company that pays 10% per month compounding interest on any amount I invest
- 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
- Lay out all your result in a nicely formmatted HTML table -->
- <html>
- <head><title>Hulk Investment</title></head>
- <body>
- <table border="1">
- <tr bgcolor="grey">
- <th>Month</th>
- <th>Earnings</th>
- <th> Net Balance</th>
- </tr>
- <?php
- $amount = $_POST['amount'];
- for ( $x = 1; $x <= 24 ; $x++){
- $earnings = ($amount * 0.1 );
- $total = $earnings + $amount;
- echo '<tr><td>'.$x.'</td>';
- echo '<td>'.number_format($earnings,2) .'</td>';
- echo '<td>'. number_format($total,2). '</td></tr>';
- $amount = $total;
- }
- ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement