kazooie21
asked on
I think it's a runtime error, but....
I don't know what's wrong here. I think I'm getting a runtime error in this:
var name: string;
numb: integer;
wt: integer;
AppFile: text;
procedure GETDATA (var localAppFile: text;
var localname: string;
var localnumb: integer;
var localwt: integer);
begin
readln (localAppFile, localname);
readln (localAppFile, localnumb);
readln (localAppFile, localwt);
end; {GETDATA}
procedure POSITION;
begin
if (numb < 10) and (wt < 180) then
writeln ('Accepted ');
if not ((numb < 10) and (wt < 180)) then
writeln ('Rejected ');
writeln ('Your weight is more than the given weight ');
writeln ('The number of cigarettes you smoke is over the limit ');
end; {POSITION}
begin {main}
assign (AppFile, 'A:\AppFile2.dat');
reset (AppFile);
while not seekeof (AppFile) do
begin
GETDATA (AppFile, name, numb, wt);
POSITION;
end;
close (Appfile)
end.
This is what I get on the "Accepted" ones:
"Accepted"
"Your weight is more than the given weight"
" The number of cigarettes you smoke is over the limit"
var name: string;
numb: integer;
wt: integer;
AppFile: text;
procedure GETDATA (var localAppFile: text;
var localname: string;
var localnumb: integer;
var localwt: integer);
begin
readln (localAppFile, localname);
readln (localAppFile, localnumb);
readln (localAppFile, localwt);
end; {GETDATA}
procedure POSITION;
begin
if (numb < 10) and (wt < 180) then
writeln ('Accepted ');
if not ((numb < 10) and (wt < 180)) then
writeln ('Rejected ');
writeln ('Your weight is more than the given weight ');
writeln ('The number of cigarettes you smoke is over the limit ');
end; {POSITION}
begin {main}
assign (AppFile, 'A:\AppFile2.dat');
reset (AppFile);
while not seekeof (AppFile) do
begin
GETDATA (AppFile, name, numb, wt);
POSITION;
end;
close (Appfile)
end.
This is what I get on the "Accepted" ones:
"Accepted"
"Your weight is more than the given weight"
" The number of cigarettes you smoke is over the limit"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER