Hey guys im new to this programming thing and im starting of with pascal.I have a small problem here is the program i want to input a number and that number will determine how man times the for loop runs the problem is the program is compliling but is stoping after i enter "Item Name"(see in red) what the heck am i doing wrong?
Program Array12 ;
uses crt;
Var
ItemN:array[1..5] of integer;
UnitP:array [1..5] of integer;
Quantity:array [1..5] of integer;
UnitT,totalprice,discount:real;
index,n:integer;
Begin
clrscr;
Writeln('Group Assignment');
Writeln('----------------');
Writeln('Enter amount of goods');
readln(n);
for index := 1 to n do
begin
Writeln('Enter Item name');
Readln(ItemN [index]);
Writeln('Enter Price');
Readln(UnitP [index]);
Writeln('Enter the quantity of item');
Readln(Quantity [index]);
UnitT:= (UnitP[index]* Quantity[index]);
totalprice:= (totalprice + UnitT);
End;
If totalprice > 5000 then
discount:=( 0.2 * totalprice);
index:= 0;
End.