Anda di halaman 1dari 5

program project1;

{Candidate Name: Clendon Donai


Candidate Number: 140004
Centtr Code: 140004
Subject: Information Technology
Profiency: General
Centre Name: Saint Lucia Seventh-day Adventist Academy
Territory: Saint Lucia}

{Problem statement : This algorithm will prompt the user to enter student names,
number of subjects passed and special awards. This algorithm will determine the
special certificate type also the algorithm will calculate each students penalty fees
, graduation fees total graduation fees , outstanding fee status and also calculate
the amount of offences committed by each student . Finally the algorithm will
compare
the Total Graduation Fee to the budget of $2500 determining if the graduation fee is
greater than, equal to or less than the budget.}

const
Budg=2500; //stores the budget set for the graduation//
Stdfee=275; //stores the standard fee for each student//
Flt_fee=195; //stores the flat fee of each student//
Intrst=0.35; //stores the interest applied to penalty fee//

var

A:integer; //Used with a for loop as a counter variable//


F_name:array[1..3] of string; //Stores the students first names//
L_name:array[1..3] of string; //Stores the students last names//
No_Ofns:array[1..3] of integer; //Stores the number of offences committed by
students//
No_SubPass:array[1..3] of integer; //Stores the number of subjects passed by
students//
OutFee_Stat:array[1..3] of string; //stores the status of the outstanding fee//
Certi_Type:array[1..3] of string; //Stores the special certificates given to students//
Spc_Hon:array[1..3] of string; //stores the special honor given the students//
Gradu_Fee:array[1..3] of real; //Stores students graduation fees//
Pena_Fee:array[1..3] of real; //Stores the penalty fees of the students after interest
is added//
TotGradu_Fee:real; //calculates the total graduation fee//
Tot_PlatCert:real; //Stores the total amount of platinum certificates//
Tot_SilvCert:real; //Stores the total amount of Silver certificates//
Tot_GoldCert:real; //Stores the total amount of gold certificates//
Tot_BrnzeCert:real; //stores the total amount of bronze certificates//
Begin
TotGradu_Fee:= 0;
Tot_PlatCert:= 0;
Tot_GoldCert:= 0;
Tot_SilvCert:= 0;
Tot_BrnzeCert:= 0;

For A:=1 to 3 Do
Begin
Writeln ('Enter student''s first name: ');
Readln (F_name [A]);
Writeln ('******************************');
Writeln ('Enter student''s last name: ');
Readln (L_name [A]);

Writeln ('Enter student''s special award: ');


Readln (Spc_Hon [A]);
Writeln ('Enter <yes> if student owes outstanding fees and <no> if they do not');
Readln (OutFee_Stat [A]);

Writeln ('Input student''s number of offences:');


Readln (No_Ofns [A]);

Writeln ('Enter number of subjects passed by student:');


Readln (No_SubPass [A]) ;

IF (No_SubPass[A] <13) and (No_SubPass[A]<=15) Then


begin

CertI_Type[A]:='Platinum';
writeln (Certi_Type[A],' ', 'certificate is given');
Tot_PlatCert:= Tot_PlatCert + 1;
End

Else If (No_SubPass[A] >11) and (No_SubPass[A] <=13) Then


Begin
Certi_Type[A]:='Gold';
writeln (Certi_Type[A],' ', 'certificate is given');
Tot_GoldCert:= Tot_GoldCert + 1;

End
Else If (No_SubPass[A] >9) and (No_SubPass[A] <=11) Then
begin
Certi_Type[A]:='Silver';
Writeln (Certi_Type[A],' ', 'certificate is given');
Tot_SilvCert:=Tot_SilvCert + 1;

End

Else If (No_SubPass[A] >7) and (No_SubPass[A] <=9) Then


begin
Certi_Type[A]:='Bronze';
Writeln (Certi_Type[A],' ', 'certificate is given');
Tot_BrnzeCert:=Tot_BrnzeCert + 1;

End;

IF (OutFee_Stat[A] = 'Yes' ) then


Begin
Pena_Fee[A] := (Flt_fee)+ (Flt_fee*Intrst*No_ofns[A]);
Gradu_Fee[A] := Stdfee+Pena_Fee[A];

End

Else if (OutFee_Stat[A] = 'No') Then


begin

Gradu_Fee[A] := StdFee;
end;

writeln (F_Name[A],L_Name[A],' ', 'graduation fee is: ', Gradu_Fee[A]:0:2 );


TotGradu_Fee:= TotGradu_Fee + StdFee;

If TotGradu_Fee >= Budg THEN


begin
Writeln ('Funds are sufficient')

end

ELSE IF TotGradu_Fee < Budg THEN


begin
Writeln ('Funds are insufficient Expense is to high!')

end;
readln;

end;
End.

Anda mungkin juga menyukai