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,FREEMAIL_FROM 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 21:49:29 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!nx02.iad01.newshosting.com!216.196.98.140.MISMATCH!border1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!attbi_feed4!attbi.com!attbi_s53.POSTED!not-for-mail From: "Steve" Newsgroups: comp.lang.ada References: <4003b00c_2@news.tm.net.my> Subject: Re: Problem from a Newbie X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: NNTP-Posting-Host: 67.160.161.145 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s53 1074059369 67.160.161.145 (Wed, 14 Jan 2004 05:49:29 GMT) NNTP-Posting-Date: Wed, 14 Jan 2004 05:49:29 GMT Organization: Comcast Online Date: Wed, 14 Jan 2004 05:49:29 GMT Xref: archiver1.google.com comp.lang.ada:4380 Date: 2004-01-14T05:49:29+00:00 List-Id: In addition to the other comments... You don't need to convert degrees to radians as you have done. There is a version of sin in Ada.Numerics.Elementary_Functions that takes a second value as the number of units in a cycle. So instead of using: sin( X * 2.0 * Pi / 360.0 ) You can use sin( X, 360.0 ) Which (I think) reads a lot cleaner. Steve (The Duck) "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