为什么我的 FreePascal 程序没有运行?

问题描述 投票:0回答:1
Program TypeofCreditCard; 
Var 
   AppliName: array[1..99] of String; 
   SSnum: array[1..99] of Integer; 
    GSal: array[1..99] of Integer; 
   TSalD: array[1..99] of Integer; 

  Name, CC : String; 
  Rep,Exp, GS,NS,Sum,TSD , YS,SSN,i, ,PofIncome : integer ; 
  YS, C_Amt: Real

Begin 
   Writeln ( 'Enter applicants who applied for a type of credit card'); 
   Readln (Rep,Exp,GS,YS,NS,Sum,TSD,SSN,CC,PofIncome) ; 

While ( Name <> ' Stop ' ) do 
   Begin 
   NS:= GS-TSD ; 
   Sum:= Exp + Rep ; 
   PofIncome:=(NS * 0.45); 
Begin 
If ( GS >4000) AND ( CC = 'Bronze Card' ) then 
   YS:= GS * 12 ; 
   C_Amt := YS * 0.25; 
   i:= i + 1; 
   AppliName [i]:= Name; 
   SSNum [i]:= SSN ; 
   GSal  [i]:= GS ; 
   TSalD [i]:= TSD ; 
End ; 
Begin 
If (GS >= 7500) AND  (CC= 'Gold Card') then 
   YS:= GS * 12 ; 
   C_Amt:= YS * 0.3; 
   i:= i + 1 ; 
   AppliName [i]:= Name; 
   SSnum [i]:=SSN; 
   GSal [i]:=GS; 
   TSalD [i]:=TSD; 
End; 
Begin 
If (GS>=10,000) AND ( CC = ' Platinum Card') then 
   YS := GS * 12; 
   C_Amt: = YS * 0.4; 
   i:= i + 1; 
   AppliName [i]:= Name; 
   SSNum [i]:= SSN; 
   GSal [i]:=GS; 
   TSalD [i]:= TSD; 

End if 
End if 
End if 
End While 
End. 

我使用 FreePascal IDE,它说我有 2 个错误。如果还有更多错误或您发现任何奇怪的情况,请通知我。错误消息显示为

Fatal:Syntax Error, ";" expected but "identifier Writeln found

消息引用源代码行

Writeln ( 'Enter applicants who applied for a type of credit card'); 
pascal freepascal
1个回答
3
投票

;
后面少了一个
YS, C_Amt: Real
。另外,每个
then
之后应该是
begin
,并且最后的所有
End if
End while
都应该是
End;

© www.soinside.com 2019 - 2024. All rights reserved.