From: "Beau" <beau@hiwaay.net>
Subject: Re: Don't read any more, I am an idiot. Fixed it myself
Date: Thu, 5 Jul 2001 17:41:00 -0500
Date: 2001-07-05T17:41:00-05:00 [thread overview]
Message-ID: <tk9r8lo3qgd21f@corp.supernews.com> (raw)
In-Reply-To: tk9pumjsd3j8b3@corp.supernews.com
subject explains it all
"Beau" <beau@hiwaay.net> wrote in message
news:tk9pumjsd3j8b3@corp.supernews.com...
> I am getting an error can someone help:
> the spec file as follows:
> ----------------------------------------------------------------
> --This is the Spec file for the package Print_Table.
> --created by Beau Elliott
> ---------------------------------------------------------------------
>
> PACKAGE Print_Table IS
>
> --------------------------------------------------------------------------
> --declarations needed in the package
>
> SUBTYPE IDnumbers IS Natural RANGE 0..9999; --subtype for ID numbers
>
> TYPE HouseHolds IS RECORD --record for each house containing its ID
> ID : IDnumbers; --number, Annual Income, and the number of
> Income : Natural; --People living there
> Members : Positive;
> END RECORD;
>
> SUBTYPE ArrayCounter IS Natural RANGE 1..25; --counter for the number of
> --houses we are using
> ArraySize : CONSTANT Positive := 25;
>
> TYPE HouseArrays IS ARRAY (ArraySize) OF HouseHolds;
>
> ListofHouses : HouseArrays;
>
> Poverty : Natural; --variable to tell if the house lives under or above
> --poverty
>
> Pause : Character; --pause between reading of tables
>
> ------------------------------------------------------------------------
> --procedures needed are:
>
> Procedure PrintList(ListofHouses : HouseHolds);
> --pre: ListofHouses array is passed already defined
> --post: The ListofHouses is printed on the screen
>
> Procedure AboveAverageIncome(ListofHouses : HouseHolds);
> --pre: ListofHouses array is passed already defined
> --post: The list of Houses that is above the poverty line is printed
> --------along with the ID and Income of the house
>
> Procedure BelowAverageIncome(ListofHouses : HouseHolds);
> --pre: ListofHouses array is passed already defined
> --post: The list of houses that is below poverty rate is printed
> --------with the House's ID
>
> END Print_Table;
>
> --------------------------------------------------------------------------
--
> ------------------------------------------------------------------
> the body of the package is as follows:
> -----------------------------------------------------
> WITH Ada.Text_IO;
> USE Ada.Text_IO;
> WITH Ada.Integer_Text_IO;
> USE Ada.Integer_Text_IO;
>
>
> PACKAGE BODY Print_Table IS
>
> PROCEDURE PrintList(ListofHouses : HouseArrays) IS
>
> BEGIN
> Put(Item => "Household Income Table. This will tell 25 ");
> New_Line;
> Put(Item => "Houses ID number, Annual Income, and how many ");
> Put(Item => "people live there.");
> New_Line(Spacing => 3);
> Put(Item => "Identification Number Annual Income");
> Put(Item => " Household Numbers");
> New_Line;
> Put(Item => "__________________________________________________");
> New_Line;
>
> FOR Counter IN ArrayCounter LOOP
> Put(Item => ListofHouses(Counter).ID, width => 6);
> Put(Item => ListofHouses(Counter).Income, Width => 6);
> Put(Item => ListofHouses(Counter).Members, Width => 6);
> New_Line;
> END LOOP;
>
> END PrintList;
>
>
> PROCEDURE AboveAverageIncome(ListofHouses : HouseHolds) IS
>
> BEGIN
> Put(Item => "This Table will represent each house that is ");
> New_Line;
> Put(Item => "above the poverty line.");
> New_Line(Spacing => 3);
> Put(Item => "Identification Number Annual Income");
> New_Line;
> Put(Item => "_______________________________________________");
> New_Line;
>
> FOR Counter IN ArrayCounter LOOP
> Poverty := 0;
> Poverty := 6500 + (750 * (ListofHouses(Counter).Member - 2));
>
> IF ListofHouses(Counter).Income >= Poverty THEN
> Put(Item => ListofHouses(Counter).ID, Width => 6);
> Put(Item => ListofHouses(Counter).Income, Width => 6);
>
> END IF;
> New_Line;
> END LOOP;
> END AboveAverageIncome;
>
> PROCEDURE BelowAverageIncome(ListofHouses : HouseHolds) IS
>
> BEGIN
> Put(Item => "This table will represent each house that is below");
> New_Line;
> Put(Item => "the poverty line.");
> New_Line(Spacing => 3);
> Put(Item => "Identification Number");
> Put(ITem => "________________________");
> FOR Counter IN ArrayCounter LOOP
> Poverty := 0;
> Poverty := 6500 + (750 * (ListofHouses(Counter).Member - 2));
> IF ListofHouses(Counter).Income < Poverty THEN
> Put(Item => ListofHouses(Counter).ID, Width => 6);
> END IF;
> New_Line;
> END LOOP;
>
> END BelowAverageIncome;
>
> END Print_Table;
> --
> ~Beau~
> beau@hiwaay.net
>
>
>
next prev parent reply other threads:[~2001-07-05 22:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-05 22:18 explain error to me Beau
2001-07-05 22:41 ` Beau [this message]
2001-07-05 22:53 ` Don't read any more, I am an idiot. Fixed it myself chris.danx
2001-07-05 22:48 ` explain error to me chris.danx
2001-07-06 2:01 ` Jeffrey Carter
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox