program T3ch18;
{an answer for tamrine 3 of chapter 18.
 writer :Akbar Zamani date:1388/3/15}
uses uadd_pro,un3ch18,crt;
var myQueue :stuff_queue;
    answer :char;
    newstuff :stuff_data;
    chose :integer;
begin{T3ch18}
 clrscr;
 myQueue.Init;
 repeat
  writeLn ('1 for add to queue ');
  writeLn ('2 for pop ');
  writeLn ('3 for send cost for an order');
  writeLn ('4 for exit ');
  repeat
   write (' chose your action >');
   readLn (chose)
  until chose in [1..4];
  case chose  of
   1: begin{add}
        answer:='y';
        writeLn ('       adding new stuff to queue      ');
        while answer in ['y', 'Y'] do
         begin{while}
          myQueue.makestuff(newstuff);
          myQueue.push(newstuff);
          {myQueue.}ask('do you want continue adding new stuff>', answer)
         end{while}
        end;{add}
   2:  myQueue.pop(newstuff);
   3:  myQueue.send_cost(newstuff);
   4: {exit}
  end;{case}
 until chose= 4;
 writeLn (' sending an order');
end.{T3ch18}