program abc; uses wincrt; var i,j,k:integer; stock, price : array [1..4] of real; item :array [1..4] of string; s : integer; begin item[1]:='Pen'; item[2]:='Ruler'; item[3]:='Pencil'; item[4]:='Eraser'; price[1]:=1.50; price[2]:=0.8; price[3]:=0.5; price[4]:=1.2; stock[1]:=1000; stock[2]:=400; stock[3]:=600; stock[4]:=200; writeln('*** Add Stock ***'); write('Enter item no.: '); readln(s); while (s >=5) and (s<=0) do begin write('Invalid number! Enter item mo. again: '); readln(s); end; case s of 1:write('How many pens do you added? '); 2:write('How many rulers do you added? '); 3:write('How many pencils do you added? '); 4:write('How many erasers do you added? '); end; readln(k); stock[s] := stock[s]+k; writeln('New stock for pen is ',stock[s]:0:0); writeln; writeln; writeln; writeln; writeln; writeln; writeln('*** Buy item ***'); write('Enter item no.: '); readln(s); while (s >=5) and (s<=0) do begin write('Invalid number! Enter item mo. again: '); readln(s); end; case s of 1:write('How many pens do you buy? '); 2:write('How many rulers do you buy? '); 3:write('How many pencils do you buy? '); 4:write('How many erasers do you buy? '); end; readln(k); if k > stock[s] then writeln('Stock is not enough! Please check stock first.') else begin writeln('Item':5,'Price ($)':12,'Quantity':12,'Total ($)':13); writeln(item[s]:5,price[s]:12:2,k:12,k*price[s]:13:2); end; end.