Your main problem is 'balance' should be a real type, as multiplying it by 1.03 will return a non integer value. Here's how I'd do it:
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
posNeg: integer;
balance: Real; // balance must be a real type (supports decimal places)
begin
try
Randomize;
Writeln('Get average balance');
posNeg:=random(2);
// Set posNeg to 1 or -1
if posNeg = 0 then
posNeg:=-1
else
posNeg:=1;
// %.2f limits the float to 2 decimal places
balance:=StrToFloat(Format('%.2f',[posNeg*(random+random(10000))]));
Writeln('Average balance is '+FloatToStr(balance));
if posNeg = -1 then
begin
Writeln('Negative balance.');
balance:=balance-20;
end else
begin
Writeln('Positive balance.');
balance:=balance*1.03;
end;
// Format to 2 decimal places
Writeln('Your new balance is ', Format('%.2f',[balance]));
readln;
except
on E:Exception do
Writeln(E.Classname, ': ', E.Message);
end;
end.
Hope that helps.
Sub Xero