menu:-message.
message:-write('==================================================='),nl,
         write('============== QUIZZ 3 FILE INPUT/OUTPUT =========='),nl,
	     write('=====  GROUP MEMBERS==============================='),nl,
		 write('=====   BEKELE HAILE ID No: 069/2000         ======'),nl,
		 write('=====   DAWIT ABRHA  ID No: 103/2000         ======'),nl,
		 write('=====   DAWIT ANEGAGRIE  ID No: 105/2000     ======'),nl,
	     write('=====           please Enter go .            ======'),nl,
	     write('==================================================='),nl.
		
:-message.
		 
go:-  write('Enter 1 to write on the file.  '),nl,
      write('Enter 2 to read from the file. '),nl,
      read(D), choice(D).
	  
choice(1):-write('Enter the text.'),nl,read(T),nl,inputTextFile('dave.txt',T),nl,
	     write('Continue (y/n)'),
         read(K),(K=y,go),nl.
		 
choice(2):-write('Here is/are the data that u write on the file.'),nl,
			display,nl,
		   write('Continue (y/n)?'),
           read(K),(K=y,go),nl.	
		   
inputTextFile(F,T):-append(F),nl,  
			write(T),         
			told.		
			
display:-
        see('dave.txt'),     
        repeat,     
        get_char(T),print(T),
		T=end_of_file,!,
		seen.
