comp.lang.ada
 help / color / mirror / Atom feed
From: Andrew <eagletalon@chartermi.net>
Subject: Re: interest computing problem
Date: Tue, 16 Sep 2003 22:48:42 -0500
Date: 2003-09-16T22:48:42-05:00	[thread overview]
Message-ID: <vmfmf3s9h40652@corp.supernews.com> (raw)
In-Reply-To: <3F6785FB.1090305@attbi.com>



Robert I. Eachus wrote:
> Andrew wrote:
> 
>>    New_Line;
>>    Put ("Your ending balance will be ");
>>    Put (Balance,1,2,0);
> 
> 
> I think this will fix your problem, if I understand what you think is a 
> problem.  If you want output in dollars and cents without exponents, 
> this will do it. Look at the documentation for Put in 
> Ada.Text_IO.Float_IO to understand why those numbers for the (otherwise 
> defaulted) parameters.
> 
OOOOH yeah.. that sounds very familiar.. I wrote the program initally in 
1997, and failed to properly document what things did and what they were 
for.

here is the output for the program as it is now
==============
How much money do you have-Please add cents? 1000.00
What is the interest you will receive? .02
How long will it be invested in weeks? 52

Your ending balance will be  1.00022E+03

============
and the ending balance should be 1020.2008 or more nicely written 1020.20
but I will try the change as you suggest.

.. .. .. ..

ok bit of a problem . now it says the output (or final balance is)
1000.22

that is not good.
and I had a friend who works at a local bank check the answer of 
1020.2008 and he says that, that is the correct answer.
any ideas?
thanks in advance.
Andrew




  reply	other threads:[~2003-09-17  3:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-16 15:27 interest computing problem Andrew
2003-09-16 15:54 ` Ludovic Brenta
2003-09-16 17:21   ` tmoran
2003-09-17  4:26     ` Andrew
2003-09-16 21:52 ` Robert I. Eachus
2003-09-17  3:48   ` Andrew [this message]
2003-09-17  4:28     ` Andrew
2003-09-17  5:18     ` tmoran
2003-09-17  7:47       ` Andrew
2003-09-17 16:05         ` Andrew
2003-09-17 16:32           ` Martin Dowie
2003-09-17 16:36           ` Stupid! -was- " Andrew
2003-09-17 17:00             ` Stephane Richard
2003-09-17 17:15               ` Andrew
2003-09-19  4:07 ` Leon Winslow
2003-09-21 22:55   ` Andrew
  -- strict thread matches above, loose matches on Subject: below --
2003-09-22  0:44 Robert I. Eachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox