compiler MaxMin語法錯誤 |
答題得分者是:老大仔
|
delphi_95
一般會員 發表:1 回覆:2 積分:0 註冊:2011-09-21 發送簡訊給我 |
學校作業
program VertexofaQuadratic; {$APPTYPE CONSOLE} uses SysUtils; (******************************************************************************) var A : Integer; B : Integer; C : Integer; XNumber : Real; YNumber : Real; (******************************************************************************) procedure Vertex; begin Write(' Enter A Number: '); ReadLn (A); WriteLn; Write(' Enter B Number: '); ReadLn (B); WriteLn; Write(' Enter C Number: '); ReadLn (C); WriteLn; MaxMin(A,B,C,XNumber,YNumber); WriteLn('The axis of symmetry for the quadratic is ' , XNumber:1:2) ; if A < 0 then begin WriteLn('The quadratic is a maximum'); WriteLn; end else WriteLn('The quadratic is a minimum') ; end; (******************************************************************************) procedure MaxMin(a:Integer;b:Integer;c:Integer;var XValue,YValue:Real); begin XValue:= -b/(2*a); YValue:= (-sqr(b)/(4*a)) c; WriteLn('The vertex is (' ,XValue:1:2, ',', YValue:1:2, ')'); end; (************************* Main Program ***************************************) procedure Main; var Choice : char; begin Repeat WriteLn('Do you want to run the Vertex of a Quadratic "Y" or "y"'); WriteLn('Exit press "E" or "e" '); ReadLn(Choice); WriteLn; while (Choice <> 'Y') and (Choice <> 'y') and (Choice <> 'E') and (Choice <> 'e') do begin WriteLn('Please re-enter "Y" or "E"'); ReadLn (Choice); WriteLn; end; if (Choice = 'Y') or (Choice = 'y') then Vertex; until (Choice = 'E') or (Choice = 'e'); end; begin Main; end. |
P.D.
版主 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
|
delphi_95
一般會員 發表:1 回覆:2 積分:0 註冊:2011-09-21 發送簡訊給我 |
|
老大仔
尊榮會員 發表:78 回覆:837 積分:1088 註冊:2006-07-06 發送簡訊給我 |
請把 program VertexofaQuadratic; 的上面即可
===================引 用 delphi_95 文 章=================== 學校作業 MaxMin(A,B,C,XNumber,YNumber); WriteLn('The axis of symmetry for the quadratic is ' , XNumber:1:2) ; if A < 0 then begin WriteLn('The quadratic is a maximum'); WriteLn; end else WriteLn('The quadratic is a minimum') ; end; (******************************************************************************) procedure MaxMin(a:Integer;b:Integer;c:Integer;var XValue,YValue:Real); begin XValue:= -b/(2*a); YValue:= (-sqr(b)/(4*a)) c; WriteLn('The vertex is (' ,XValue:1:2, ',', YValue:1:2, ')'); end; (************************* Main Program ***************************************) procedure Main; var Choice : char; begin Repeat WriteLn('Do you want to run the Vertex of a Quadratic "Y" or "y"'); WriteLn('Exit press "E" or "e" '); ReadLn(Choice); WriteLn; while (Choice <> 'Y') and (Choice <> 'y') and (Choice <> 'E') and (Choice <> 'e') do begin WriteLn('Please re-enter "Y" or "E"'); ReadLn (Choice); WriteLn; end; if (Choice = 'Y') or (Choice = 'y') then Vertex; until (Choice = 'E') or (Choice = 'e'); end; begin Main; end.
編輯記錄
老大仔 重新編輯於 2011-12-04 17:05:11, 註解 無‧
|
delphi_95
一般會員 發表:1 回覆:2 積分:0 註冊:2011-09-21 發送簡訊給我 |
|
老大仔
尊榮會員 發表:78 回覆:837 積分:1088 註冊:2006-07-06 發送簡訊給我 |
因為 program VertexofaQuadratic 中有呼叫到 procedure MaxMin;
所以 程式會"往回找" 但因為找不到procedure MaxMin 所以會出現 "Undeclared identifier 'MaxMin' at line 27(27:2)" 程式不知道從何呼叫它~ 請先翻書&多多爬文~ 有很多基本的東西書本都會教的~^^ ===================引 用 delphi_95 文 章=================== 根基不夠的我 請教 為什麼要移到program上面? |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |