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,1d7c081f926f119a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-13 04:37:36 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!bigfeed2.bellsouth.net!bigfeed.bellsouth.net!bignumb.bellsouth.net!news.bellsouth.net!bignews6.bellsouth.net.POSTED!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada References: <4003b00c_2@news.tm.net.my> Subject: Re: Problem from a Newbie MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: X-Trace: ofjmidbaofeaohdodbdpiflmbcekedmfhojhikkbagflhcboigidobkjjjecmfhemnlelhopainalnagmjnennlenabomgilbpeclalcloiihiplolcepfpblegecelalajhomanhcbcjabdjcinkbkbgoimmfac NNTP-Posting-Date: Tue, 13 Jan 2004 07:35:59 EST Date: Tue, 13 Jan 2004 06:37:27 -0600 Xref: archiver1.google.com comp.lang.ada:4363 Date: 2004-01-13T06:37:27-06:00 List-Id: The Sin function is contained in the package Ada.Numerics.Generic_Elementary_Functions which must be "withed," and then instantiated for type "Float." The result of the function is a value of type "Float," so it cannot be assigned to the Integer variable "Y," as you have done in your code. Also, the loop variable "R" in your code must be a discrete type, not a real type. "Cecilia Chew" wrote in message news:4003b00c_2@news.tm.net.my... > Hello All, > I'm a newbie in Ada. There are a lot of question mark in my mind. I'm > now doing a simple program and the desired output is a signal wave as below. > > * ** ** * > * * * * * * > * * * * * * > ** ** ** > And the coding that i have done is as follow. > > with Ada.Text_Io, Ada.Float_Text_IO; > use Ada.Text_Io, Ada.Float_Text_IO; > > procedure Graph1 is > Y : Integer; > Max_Point : Float; > Min_Point : Float; > Pi : Constant := 3.142; > begin > > Max_Point := 1.0; > for X in 0 .. 360 loop > for r in 0.0 .. Max_Point loop > Y := sin (X * 2 * Pi/360); > Put ("*"); > end loop; > end loop; > end Graph1; > > Could someone tell me what are the mistakes in the coding? Error message > from the compiler is the 'sin' is undefined. what should i do with this? > > > -- > Cecilia Chew > c e c i l i a g r e e n l i m e . c o m > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada-france.org > http://www.ada-france.org/mailman/listinfo/comp.lang.ada > >