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,5d7204ff396525aa X-Google-Attributes: gid103376,public From: "bklungle" Subject: Re: Please help link list! Date: 1997/12/05 Message-ID: <668kd0$mmc@dfw-ixnews3.ix.netcom.com> X-Deja-AN: 295433040 References: <01bd0074$856c1020$8d484893@default> X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Organization: B & D Associates X-NETCOM-Date: Fri Dec 05 4:18:08 AM CST 1997 Newsgroups: comp.lang.ada Date: 1997-12-05T04:18:08-06:00 List-Id: This is a multi-part message in MIME format. ------=_NextPart_000_0026_01BD0124.8F17E440 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am afraid I have to agree with Jerry Van Dijk. I had your code = rewritten and working and ready to send it to you, along with the pseudo = code (structured english statements) for it. I read Jerry's comment and = decided it wasn't fair to do your work for you. As a hint, you started = out ok, then seem to have forgotten what a link list is, or you are = trying to design on the terminal using code. Unless you are an expert in = a language, you shouldn't do this. Draw a detailed flowchart, or do a = Nassi-Schneiderman, or write a pseudo-code detailed description of the = steps, or do it in spanish, or, ...; remember, your instructor is your = best friend in this endeaver. Incidentally, every book I have ever seen = on Ada, Pascal, C, etc has code in it to do almost exactly what you are = doing.=20 cheers...bob Eric Sabo wrote in message <01bd0074$856c1020$8d484893@default>... What am I doing wrong with this program? with gnat.io; use gnat.io; procedure testing is type link_integer; type pointer is access link_integer; type link_integer is record number : integer; next : pointer; end record;=20 first, last, p : pointer; temp : integer; begin =20 put("Project Number two"); p :=3D new link_integer; first :=3D p; last :=3D p; -- Entering the link list put_line("Please enter a number: "); get(temp); while temp /=3D -99 loop p.number :=3D temp; p :=3D new link_integer; last.next :=3D p; first.number :=3D temp; last :=3D p; put_line("Please enter a number: "); get(temp); first.number :=3D temp; first.next :=3D p; end loop; =20 -- printing outing the link list temp :=3D first.number; while temp /=3D last.number loop put("The number is "); put(temp); =20 temp :=3D p.number; end loop;=20 end testing; =20 Thanks, Eric Sabo sabo@hhs.net ------=_NextPart_000_0026_01BD0124.8F17E440 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I  am afraid I have to agree = with Jerry Van=20 Dijk. I had your code rewritten and working and ready to send it to you, = along=20 with the pseudo code (structured english statements) for it. I read = Jerry's=20 comment and decided it wasn't fair to do your work for you. As a hint, = you=20 started out ok, then seem to have forgotten what a link list is, or you = are=20 trying to design on the terminal using code. Unless you are an expert in = a=20 language, you shouldn't do this. Draw a detailed flowchart, or do a=20 Nassi-Schneiderman, or write a pseudo-code detailed description of the = steps, or=20 do it in spanish, or, ...; remember, your instructor is your best friend = in this=20 endeaver. Incidentally, every book I have ever seen on Ada, Pascal, C, = etc has=20 code in it to do almost exactly what you are doing.
 
cheers...bob
Eric Sabo wrote in message=20 <01bd0074$856c1020$8d484893@default>...
What am I doing wrong with this=20 program?
with = gnat.io; use=20 gnat.io;
procedure testing is
type link_integer;
type = pointer is=20 access link_integer;
type link_integer is
  =20 record
      number :=20 integer;
      next : = pointer;
  =20 end record;
 
first, last, p : pointer;
temp :=20 integer;
begin
     =
    =20 put("Project Number two");
     p = :=3D new=20 link_integer;
     first :=3D=20 p;
     last :=3D p;
-- Entering the link=20 list
     put_line("Please enter a = number:=20 ");
     = get(temp);
    =20 while temp /=3D -99 = loop
        =20 p.number :=3D = temp;
         p :=3D=20 new = link_integer;
        =20 last.next :=3D = p;
        =20 first.number :=3D = temp;
        =20 last :=3D p;
        =20 put_line("Please enter a number:=20 ");
        =20 get(temp);
         = first.number=20 :=3D temp;
         = first.next :=3D=20 p;
     end = loop;     =20
-- printing outing the link list
   temp :=3D=20 first.number;
   while temp /=3D last.number=20 loop
      put("The number is=20 ");
     =20 put(temp);      =
     =20 temp :=3D p.number;
   end loop;
 
end testing;
 
Thanks,
Eric Sabo
sabo@hhs.net
------=_NextPart_000_0026_01BD0124.8F17E440--