0% found this document useful (0 votes)
63 views3 pages

Pascal Code

The program tracks points from 4 houses in an athletic event. It collects the house names and their points, calculates the total points, and identifies the house with the most points (maxhouse) and least points (minhouse). It then calculates award amounts for the maxhouse and minhouse based on a total funding amount. It outputs the victorious and trailing houses, their points, and their award amounts.

Uploaded by

api-291113595
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views3 pages

Pascal Code

The program tracks points from 4 houses in an athletic event. It collects the house names and their points, calculates the total points, and identifies the house with the most points (maxhouse) and least points (minhouse). It then calculates award amounts for the maxhouse and minhouse based on a total funding amount. It outputs the victorious and trailing houses, their points, and their award amounts.

Uploaded by

api-291113595
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Program Athletic_Sports_Meet_Event;

Var
i, total, max,min:integer;
hpt:array[1..4]of integer;
house:array[1..4] of string;
maxhouse,minhouse:string;
maxamt,minamt,totalamt:real;

BEGIN
i:=0;
total:=0;
max:=0;
min:=1000;
maxhouse:='';
minhouse:='';
totalamt:=140000;
for i:= 1 to 4 do
begin
house[i]:='';
hpt[i]:=0;
end;

For i:= 1 to 4 do
begin
write('Enter the house name');
Candidate Name: Amilla Morille
Candidates Registration Number: 1400100922
Centre Number: 140010

readln(house[i]);

write(' Enter the points amassed by the house ');


readln(hpt[i]);
writeln;

IF hpt[i] < 0 Then


repeat
writeln('You have entered an unenforceable value. Please enter a value larger
than 0');
readln(hpt[i]);
writeln;
until hpt[i] > 0;

total:=total + hpt[i];
end;

For i:= 1 to 4 do
begin
If hpt[i]> max then
begin
max:= hpt[i];
maxhouse:= house[i];
end;

If hpt[i]< min then


begin
Candidate Name: Amilla Morille
Candidates Registration Number: 1400100922
Centre Number: 140010

min:=hpt[i];
minhouse:=house[i];
end;
End;

maxamt:=0.45*140000;
minamt:=0.17*140000;
writeln;
writeln('The victorious house was ',maxhouse);
writeln('The treasuries award to ',maxhouse,'is $',maxamount:5:2);
writeln('Victorious house points: ',max);
writeln('The trailing house was ',minhouse);
writeln('The lowest score was ',min);
writeln(minhouse,' received $Content ',minamt:5:2);
writeln('The total house points was: ',total);

END.

Candidate Name: Amilla Morille


Candidates Registration Number: 1400100922
Centre Number: 140010

You might also like