comp.lang.ada
 help / color / mirror / Atom feed
From: "Martin Dowie" <martin.dowie@btopenworld.com>
Subject: Re: interest computing problem
Date: Wed, 17 Sep 2003 16:32:49 +0000 (UTC)
Date: 2003-09-17T16:32:49+00:00	[thread overview]
Message-ID: <bka2bh$4m9$1@sparta.btinternet.com> (raw)
In-Reply-To: vmh1jlmbuvrb8f@corp.supernews.com

"Andrew" <eagletalon@chartermi.net> wrote in message
news:vmh1jlmbuvrb8f@corp.supernews.com...
> ok after a few hours of sleep.. I got Long_Float to work(aka the program
> compiled), but the input/output that I got is still
>
> 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 1000.20
>
>
> as you can see it now says that the ending balance is 1000.20 which is
> changed from 1000.22 (and the can probably be attributed to the fact
> that I am using Long_Float instead of Float).  but I am still at the
> problem of the answer should be 1020.20 (or the full answer that he came

You input ".02" which you are then dividing by 100 to get a percentage, so
your "bank" is paying 0.0002% - I'd say 20cents is about right at that rate!

Try your same program but enter "2.0" (miss quotation marks) for the
second value and you will get the result "1020.14" - which is a lot
closer...






  reply	other threads:[~2003-09-17 16:32 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
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 [this message]
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