From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e99ea9c9d228f6b8,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-16 08:28:21 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: Andrew Newsgroups: comp.lang.ada Subject: interest computing problem Date: Tue, 16 Sep 2003 10:27:04 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:42574 Date: 2003-09-16T10:27:04-05:00 List-Id: ok I've run into a snag .. and i'm hoping that a programmer can help me out. here is a copy of my program (written in Ada) ==== -- computes Interest on money invested with TEXT_IO; use TEXT_IO; procedure Interest is Initialamt : Float; Interest : Float; TimeNWeeks : Integer; DRate : Float; Days : Integer; Balance : Float; package NUMBER_IO is new INTEGER_IO(INTEGER); use NUMBER_IO; package Float1_IO is new Float_IO(FLOAT); use Float1_IO; begin New_Line; Put ("How much money do you have-Please add cents? example 365.22 "); Get (Initialamt); Put ("What is the interest you will receive? "); Get (Interest); Put ("How long will it be invested in weeks? "); Get (TimeNWeeks); New_Line; Days:=TimeNWeeks * 7; DRate:=(Interest/100.0)/365.0; Balance:=Initialamt * (1.0+DRate)**Days; New_Line; Put ("Your ending balance will be "); Put (Balance); New_Line; end Interest; ======================================== now here is the output from when I try to run the program ================== How much money do you have-Please add cents? .02 What is the interest you will receive? 25 How long will it be invested in weeks? 4 Your ending balance will be 2.03872E-02 [andrew@stc program]$ ./interest How much money do you have-Please add cents? .02 What is the interest you will receive? .25 How long will it be invested in weeks? 4 Your ending balance will be 2.00038E-02 ============ but I'm hoping that this is just a simple case of I .. well *L* I'm hoping this is a simple error that I'm overlooking.. sub-note : this program is directly copied from a printout of a program that I wrote in college (and it worked on the colleges computers). By the way I'm writing this on a Red Hat Linux 9.0 computer (I don't think that would matter but ..)