1. -- repair this program according to the lab sheet. 
  2.  
  3. with Ada.Text_IO; use Ada.Text_IO; 
  4.  
  5. procedure Counter_Test_Synchronized is 
  6.  
  7.    Sum : Natural := 50; 
  8.  
  9.    task type Counter (Id : Positive; Goal : Natural); 
  10.  
  11.    task body Counter is 
  12.  
  13.    begin 
  14.       while Sum /= Goal loop 
  15.          Sum := (if Sum > Goal then Sum - 1 else Sum + 1); 
  16.          Put (Natural'Image (Sum)); 
  17.          delay 0.0; -- try leaving out this delay statement! 
  18.       end loop; 
  19.  
  20.       New_Line; 
  21.       Put_Line ("Counter task" & Positive'Image (Id) & " terminates with sum being:" & Natural'Image (Sum)); 
  22.    end Counter; 
  23.  
  24.    Counter_1 : Counter (1, 30); 
  25.    Counter_2 : Counter (2, 40); 
  26.    Counter_3 : Counter (3, 60); 
  27.    Counter_4 : Counter (4, 70); 
  28.  
  29. begin 
  30.    New_Line; 
  31.    Put_Line ("Counter_Test terminates with sum being:" & Natural'Image (Sum)); 
  32. end Counter_Test_Synchronized;