This is Just a piece of the code
I'm having trouble printing out my solution. It works fine but its not in the right columns. Would anybody know whats causing this problem. Thanks.
print"\nYear\t\tBalance\t\tInterest\t\tNew Balance\n\n"; $convertInterest = ($annualInterest/100); $year = 2015; while($startAge <= $endAge){ $InterestGained = $startAmount * $convertInterest; $NewBalance = $InterestGained + $startAmount; $Interestrounded = sprintf("%.2f", $InterestGained); $NewBalancerounded = sprintf("%.2f", $NewBalance); $StartAmountRounded = sprintf("%.2f", $startAmount); print"$year"."\t\t"."$StartAmountRounded"."\t\t"."$Interestrounded"."\ +t\t"."$NewBalancerounded"."\n"; $startAmount = $NewBalance + $yearlyDeposit; $year++; $startAge++; };#ends while loop
In reply to Print output looks wierd by programmercarlito
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |