















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















32 lines: No errors
Hw_7 Package Specification Listing
GNAT 3.15p (20020523) Copyright 1992-2002 Free Software Foundation, Inc.
47 lines: No errors
Main Program Listing
GNAT 3.15p (20020523) Copyright 1992-2002 Free Software Foundation, Inc.
. ----------------------------------------------- . -- Program to read input string from a file . -- if it is a palindrome . -- store in output file . -- else . -- reverse string and store in output file . -- Programmer: Joe B . -- Date Last Modified : March 16, 2004 . ------------------------------------------------ . . with Ada.Text_Io; . with Hw_7; . . procedure File_Based_Palindrome is . . Input_File : Ada.Text_Io.File_Type; . Input_File_Name : String := "my_program_input.txt"; . . Output_File : Ada.Text_Io.File_Type; . Output_File_Name : String := "my_program_output.txt"; . . -- variable to store the string read from input_file . Input_String : String (1..80); . -- variable to store the length of the input_string . Input_Length : Integer; . . begin . -- open input file . Ada.Text_Io.Open(Input_File, Ada.Text_Io.In_File, Input_File_Name); . -- create the output file . Ada.Text_Io.Create(Output_File, Ada.Text_Io.Out_File, Output_File_Name); . . -- repeat while there are strings in the file . while not Ada.Text_Io.End_Of_File(Input_File) loop . -- read input from input_file . Ada.Text_Io.Get_Line(Input_File, Input_String, Input_Length);
53 lines: No errors
GNAT 3.15p (20020523) Copyright 1992-2002 Free Software Foundation, Inc.
12 - 95. regular stack operations hence not listed