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,C_Amt,PofIncome : integer ;
Begin
Writeln ( 'Enter applicants who applied for a type of credit card');
Readln (Rep,Exp,GS,YS,NS,Sum,TSD,SSN,CC,PofInco... ;
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 := Name;
SSNum := SSN ;
GSal [ i]:= GS ;
TSalD := TSD ;
End ;
Begin
If (GS >= 7500) AND [CC= 'Gold Card'] then
YS:= GS * 12 ;
C_Amt:= YS * 0.3;
i:= i + 1 ;
AppliName := Name;
SSnum:=SSN;
GSal:=GS;
TSalD:=TSD;
End;
Begin
If (GS>=10,000) AND ( CC = ' Platinum Card') then
YS := GS * 12;
C_Amt: = YS * 0.4;
i:= i + 1;
A ppliName := Name;
SSNum := SSN;
GSal :=GS;
TSalD := TSD;
End if
End if
End if
End While
End.
The five errors are :
1. Error:Incompatible types: got "Boolean" expected "LongInt" - For this line : If (GS >= 7500) AND [CC= 'Gold Card'] then
2.Error:Incompatible types: got " Set of Boolean" expected " LongInt" - for the same line (If (GS >= 7500) AND [CC= 'Gold Card'] then )
3.Error:Incompatible types: got "single" expected "smallint" - for C_Amt := YS * 0.25 ; in Bronze Card
4.Error:Incompatible types: got "extended" expected "smallint" for C_Amt := YS * 0.3; in Gold Card
5.Fatal:syntax error , ")" expected but "," found - (If GS >= 10000) AND [CC= 'Platinum'] then )
Thanks for any help. I know my program is by no means perfect because I am awful at Pascal and desperately need help on fixing these things. So I am open to anything that will get this program running in Pascal. Thanks.
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,C_Amt,PofIncome : integer ;
Begin
Writeln ( 'Enter applicants who applied for a type of credit card');
Readln (Rep,Exp,GS,YS,NS,Sum,TSD,SSN,CC,PofInco... ;
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 := Name;
SSNum := SSN ;
GSal [ i]:= GS ;
TSalD := TSD ;
End ;
Begin
If (GS >= 7500) AND [CC= 'Gold Card'] then
YS:= GS * 12 ;
C_Amt:= YS * 0.3;
i:= i + 1 ;
AppliName := Name;
SSnum:=SSN;
GSal:=GS;
TSalD:=TSD;
End;
Begin
If (GS>=10,000) AND ( CC = ' Platinum Card') then
YS := GS * 12;
C_Amt: = YS * 0.4;
i:= i + 1;
A ppliName := Name;
SSNum := SSN;
GSal :=GS;
TSalD := TSD;
End if
End if
End if
End While
End.
The five errors are :
1. Error:Incompatible types: got "Boolean" expected "LongInt" - For this line : If (GS >= 7500) AND [CC= 'Gold Card'] then
2.Error:Incompatible types: got " Set of Boolean" expected " LongInt" - for the same line (If (GS >= 7500) AND [CC= 'Gold Card'] then )
3.Error:Incompatible types: got "single" expected "smallint" - for C_Amt := YS * 0.25 ; in Bronze Card
4.Error:Incompatible types: got "extended" expected "smallint" for C_Amt := YS * 0.3; in Gold Card
5.Fatal:syntax error , ")" expected but "," found - (If GS >= 10000) AND [CC= 'Platinum'] then )
Thanks for any help. I know my program is by no means perfect because I am awful at Pascal and desperately need help on fixing these things. So I am open to anything that will get this program running in Pascal. Thanks.