(*Write a program to search for the name of a product out of a stock database in a warehouse. *) (* Techniques : Searching of an element in an array by REPEAT loop. The searching is incremented by loop counter i:=i+1. Set Flag=0 before searching, Flag=1 when the element is found. *) {* Winnie Leung F.4CA (22) *} Program search_product; uses wincrt; var prod_no:array [1..5] of integer; prod_name:array[1..5] of string; unit_price:array [1..5] of integer; quantity:array [1..5] of integer; i,p_num,flag:integer; Begin prod_no[1]:=12335; prod_name[1]:='Acer scanner'; unit_price[1]:=750; quantity[1]:=38; prod_no[2]:=13386; prod_name[2]:='Panasonic web camera'; unit_price[2]:=430; quantity[2]:=67; prod_no[3]:=15662; prod_name[3]:='Sony digital camera'; unit_price[3]:=750; quantity[3]:=38; prod_no[4]:=18976; prod_name[4]:='Toshiba MP3 player'; unit_price[4]:=1250; quantity[4]:=73; prod_no[5]:=16231; prod_name[5]:='Seagate hard disk'; unit_price[5]:=1680; quantity[5]:=55; i:=1; write('Product number : '); readln(p_num); flag:=0; repeat if prod_no[i]=p_num then begin writeln('Product number : ',prod_no[i]); writeln('Product name : ',prod_name[i]); writeln('Unit price : ',unit_price[i]); writeln('Quantity : ',quantity[i]); flag:=1 end; i:=i+1; until i>6; if flag=0 then writeln('The product is not found.') End.