You are on page 1of 2

Program myArray;

Var

name:Array[1..6]of string ;

price:Array[1..6] of Real ;

i, Counter :integer;

item: string;

p:real;

Begin

Counter:=1;

Writeln ('Enter the name of item', Counter);

Readln (item);

Writeln ('Enter the price of the item');

Readln (p);

For i:= 1 to 6 DO

Begin

Name[Counter]:= Item;

Price[Counter]:= p;

Counter:= Counter +1;

Writeln('Enter the name of the item into the list');

Readln(item);

Writeln('Enter the price of the item into the list');

Readln (p);

End;

Writeln ('The list is');

For i:=1 to counter Do

Begin

Writeln (Name [i],' ', Price [i]:4:2);

End;

Readln ();

End.

You might also like