home *** CD-ROM | disk | FTP | other *** search
- -- Chapter 25 - Programming exercise 1
- with Text_IO;
- use Text_IO;
-
- procedure CH25_1 is
-
- package Int_IO is new Text_IO.Integer_IO(INTEGER);
- use Int_IO;
-
- task Gourmet is
- entry Make_A_Hot_Dog;
- end Gourmet;
-
- task body Gourmet is
- begin
- Put_Line("I am ready to make a hot dog for you");
- for Index in 1..4 loop
- accept Make_A_Hot_Dog do
- null;
- end Make_A_Hot_Dog;
- delay 0.8;
- Put("Put hot dog in bun ");
- Put_Line("and add mustard");
- end loop;
- Put_Line("I am out of hot dogs");
- end Gourmet;
-
- begin
- for Index in 1..4 loop
- Gourmet.Make_A_Hot_Dog;
- delay 0.1;
- Put_Line("Eat the resulting hot dog");
- New_Line;
- end loop;
- Put_Line("I am not hungry any longer");
- end CH25_1;
-
-
- -- Result of execution
-
- -- I am ready to make a hot dog for you
- -- Eat the resulting hot dog
- --
- -- Put hot dog in bun and add mustard
- -- Eat the resulting hot dog
- --
- -- Put hot dog in bun and add mustard
- -- Eat the resulting hot dog
- --
- -- Put hot dog in bun and add mustard
- -- Eat the resulting hot dog
- --
- -- I am not hungry any longer
- -- Put hot dog in bun and add mustard
- -- I am out of hot dogs
-
-