Hi,
I've been struggling with this for hours now.
Can someone please help / point me in the right direction.
It was set out as a boolean excercise but I've amended it a little by using procedures instead, this is minor as I shoudl jsut be able to revert it, I was trying to eliminate the global variables.
procedure AskNumber;
var numcheck:integer;
begin
writeln('What number/s would you like to check?');
readln(numcheck);
posi:=0; negi:=0; zero:=0;
if numcheck>0 then writeln('This is a positive number');
readln(posi);posit:=posi; {read as last number input, not counting}
if numcheck<0 then write('This is a negative number');
// read(negi); negit:=negit+1;
if numcheck=0 then write('This number is Zero');
// read(zero);zerot:=zero+1;
end;
procedure AskTotal;
var count,totnum:integer;
begin
writeln('How many numbers will you like to check? ');
readln(totnum);
for count:= 1 to totnum do AskNumber //or 0 to totnum-1
end;
begin {main program}
AskTotal;
writeln(posit,negit,zerot);
{up to 33750}
end.
I need the program to decided whether a number is positive etc, this works fine. The part I'm stuck on is asking it to 'count' the number of pos/neg etc and to then display that number at the end.
The read line that i have is reading the number as an integer and not as a (+1) to be added. I've played arounfg with it so much but can't fget the fking thing to work.
Help!