科目三考試中常見的問題解析
改錯題(共4道)
1. 指出下列代碼錯誤并說明原因:
Var
I:Integer;(超出范圍)
L:Long;
Begin
L:=32768;
I:=L;
End.

2. 指出下列代碼錯誤并說明原因:
if n>37.5 then
AmountEarned:=(n-37.5)*HourlyRate*1.5+37.5*HourlyRate; (沒有定義n, AmountEarned, HourlyRate)
else
AmountEarned:= n*HourlyRate;
3. 指出下列代碼錯誤并說明原因:
while (total<max) and (sum<=max) and (sum<total)
do statement1;
4. 指出下列代碼錯誤并說明原因:
procedure Tform1.TestBtnClick(Sender:Tobject);
var z,y,x:integer;
begin
x:=100;
y:=0;
try
z:=x div y;
except
on EdivByZero
do begin
z:=-1;
MessageDlg(\'Z\'+IntToStr(z),mtInformation,[mbOK],0);
end
End;
【科目三考試中常見的問題解析】相關(guān)文章:
科目三考試常見問題解析11-07
科目三考試常見的問題04-19
科目三考試常見問題05-15
科目三考試的常見問題04-08
科目三考試常見的問題與對策12-14
科目三考試常見問題詳解03-14
科目三路考常見的問題及解析04-09
科目四考試常見問題05-23
科目三考試的解析02-04
- 相關(guān)推薦