programmercarlito has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Print output looks wierd
by hdb (Monsignor) on Mar 14, 2015 at 07:41 UTC | |
by programmercarlito (Novice) on Mar 14, 2015 at 15:50 UTC | |
by hdb (Monsignor) on Mar 14, 2015 at 16:30 UTC | |
|
Re: Print output looks wierd
by pme (Monsignor) on Mar 14, 2015 at 06:32 UTC |