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-Thread: 103376,bc4137777a63bff X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 25 Jul 2005 22:15:19 -0500 From: "Steve" Newsgroups: comp.lang.ada References: <1122305318.728942.304120@f14g2000cwb.googlegroups.com> Subject: Re: Help needed for ada package Date: Mon, 25 Jul 2005 20:17:50 -0700 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Message-ID: <2OudnZo-iL1aN3jfRVn-iQ@comcast.com> NNTP-Posting-Host: 24.22.63.157 X-Trace: sv3-AYUf+QfcHlBljLhsg3QsFFDycrdaEa0XKh+7kV1o3nUN0xzEJLDMKfb5fx+Jn7dE4l9pCQqqf4IDmCl!O7iiY3VfjRKznChksywQD6srEKqNck16La8tNdaASIAgsg+KF6VaU1fLsrBEE29idygqzmov+ZY= X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:3776 Date: 2005-07-25T20:17:50-07:00 List-Id: wrote in message news:1122305318.728942.304120@f14g2000cwb.googlegroups.com... > To anyone interested, > > I very urgently need this ada 95 package written for me and I am > willing to pay anyone for their time. Here is the specification; > > The is supposed to be a basic database to monitor a group of made up > citizens and their badness rating. > > generic > type ID is (<>); --some discrete type to be put here > package POP is > --update database > type Rating is new Integer range 0..255; > procedure Rate (Citizen : in ID; > Badness : in Rating); > procedure Associate (Citizen_1, Citizen_2 : in ID); > --query the database > function Most_Dangerous return ID; > function Next_Member return ID; > function More_In_Group return Boolean; > --administrative > procedure reset; > end POP; > Sorry I don't have enough time to write the whole thing write now, but here's a start (maybe someone else will step in to fill in another routine): with Ada.Unchecked_Deallocation; package body POP is type RO0O is record lll1 : ID; ll1l : Rating; end record; type ROO0 is array( positive range <> ) of RO0O; type R0OO is access all ROO0; procedure RO00 is new Ada.Unchecked_Deallocation( ROO0, R0OO ); R00O : R0OO; R0O0 : Natural := 0; procedure Associate (Citizen_1, Citizen_2 : in ID) is begin null; end Associate; function More_In_Group return Boolean is begin return More_In_Group; end More_In_Group; function Most_Dangerous return ID is begin return Most_Dangerous; end Most_Dangerous; function Next_Member return ID is begin return Next_Member; end Next_Member; procedure Rate (Citizen : in ID; Badness : in Rating) is begin if R0O0 = 0 then R00O := new ROO0( 1 .. 100 ); end if; if R0O0 + 1 > R00O.all'length then declare R000 : R0OO; begin R000 := new ROO0( 1 .. R0O0 + 100 ); R000.all( 1 .. R0O0 ) := R00O.all( 1 .. R0O0 ); RO00( R00O ); R00O := R000; end; end if; R0O0 := R0O0 + 1; R00O( R0O0 ).lll1 := citizen; R00O( R0O0 ).ll1l := badness; end Rate; procedure reset is begin null; end reset; end POP; Steve (The Duck) > > You cannot change this specification in any way other than to insert > the appropriate type for ID; > As you can see this is supposed to be a database package, it should not > however do any input or output to the screent as the GUI is being > designed by someone else. > > Rate is supposed to enter a citizen with his/her ID (integer) and their > badness (integer) into the database. > Associate is used to tell the database two citizens are associated to > be in the same group. > Most_Dangerous is supposed to return the citizen with the highest > badness rating. This function can do anything if the database is empty. > Next_Member reports a previously unreported member of the group to > which the most dangerous citizen belongs. This function can do anything > if the there are no more unreported members. > More_In_Group which is true exactly when there are unreported members > of the group to which the most recently reported most dangerous citizen > belongs. This function can do anything if there is no previous call to > Most_Dangerous. > The procedure rest resets the database to its original state. > > There will be no more than 1 million citizens entered. Updates should > be optimised at the expense of queries. Do not worry too much about > error handling. > > The program is supposed to be compiled on gnat. I require both the code > and a compiled file. > > Again, if anyone is interested I'm willing to pay for your services. >