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');
;
后面少了一个YS, C_Amt: Real
。另外,每个 then
之后应该是 begin
,并且最后的所有 End if
和 End while
都应该是 End;