You are on page 1of 3

Program Specialist;

var s_type: array[1..6] of String; s_category: array[1..3] of String; i,x,tot_entered, tot_approved: Integer; s_entered,cat_type: String; cat_a, cat_b, cat_c: Integer;

BEGIN for i := 1 to 6 do Begin Writeln('Enter the different types of specialist'); {Populates an array with the six types of Specialist} Readln(s_type[i]); end; {End for loop}

Writeln; tot_entered := 0; tot_approved := 0;

for x := 1 to 3 do Begin Writeln('Enter the Operational Categories'); {Populates an array with A,B,C for operational categories} Readln(s_category[i]); end;

Writeln;

Writeln('Enter Specialist type data. Type ''END'' when done');{accepts user data to compare to what is inside array} Readln(s_entered);

while s_entered <> 'END' do Begin x := 1; while (x <= 6) AND (s_type[x] <> s_entered) do Begin x := x + 1; end; {end inner while} if x <= 6 then begin tot_entered := tot_entered + 1; tot_approved := tot_approved +1; Writeln('Enter Operation Category, A, B or C'); Readln(cat_type); if cat_type = 'A' Then cat_a := cat_a +1 else if cat_type = 'B' Then cat_b := cat_b + 1 else

cat_c := cat_c +1 end else begin Writeln('Specialist not found'); tot_entered := tot_entered +1; end;

Writeln('Enter Specialist type data. Type ''END'' when done');{accepts user data to compare to what is inside array} Readln(s_entered);

End; {End while}

Writeln; Writeln('The number of Specialist fields entered is ',tot_entered); Writeln('The number of approved fields is ',tot_approved);

Writeln('Total fees in Category A is $',cat_a * 700,'.00'); Writeln('Total fees in Category B is $',cat_b * 500,'.00'); Writeln('Total fees in Category C is $',cat_c * 300,'.00'); Writeln('Total fees Collected is $',(cat_a * 700) + (cat_b * 500) + (cat_c *300),'.00'); Readln; END.

You might also like