Sunteți pe pagina 1din 9

Input

House Name
House Points
House Funds

Processing
Read House Name
Read House Points
Read Funds
Calculate total points aggregated in the athlete sprint

Output
Print House Name
Print Points
Print Funds
Total Points

events
Calculate 45% of funds to the house with the highest

Print Highest amount

points
Calculate 17% of funds to the house with the least points

Print Least amount

Print House Name


Print Points
Print Funds
Print Total Points

Input Processing Output (IPO) Chart

Name of Engineer: Amilla Morille


Program: Athletic Sports Meet Event
Aims of the project: To compute total funds admeasured to various houses participating in the
Summersdale athletics sprint events.
Date Generated: March 9th, 2015

Candidate Name: Amilla Morille


Candidates Registration Number: 1400100922
Centre Number: 140010

Programming Arrays

HouseName: array [14]


Array type: String
For i= 1 to 4 Do
Read HouseName
End for

Housepoints: array [14]


Array type: Integer
For i= 1 to 4 Do
Read House points
End for

Candidate Name: Amilla Morille


Candidates Registration Number: 1400100922
Centre Number: 140010

Algorithm
Var
HouseName: string;
Points: integer;
totalfund: real;

For 1 to 4
Print HouseName
Read HouseName
Print Enter points
Read Points
Endfor
Read totalfund
Maxfund= 0.45* totalfund
Minfund=0.17*totalfund
For 1 to 4
Totalpoints = totalpoints+points
Endfor

For 1 to 4
If Highestpoint< points then
Highestpoint= points
Candidate Name: Amilla Morille
Candidates Registration Number: 1400100922
Centre Number: 140010

END IF
END FOR

For 1 to 4
If Minpoint> points then
Minpoint= points
END IF
END FOR
Print house with maximum amount
Print Maxfund
Print house with minimum amount
Print Minfund

Candidate Name: Amilla Morille


Candidates Registration Number: 1400100922
Centre Number: 140010

Pseudo Code
Program Athletic_Sports_Meet_Event;
{Program header}

Var
i, total, max,min:integer;
hpt:array[1..4]of integer;

{Declaration of

variables}
house:array[1..4] of string;
maxhouse,minhouse:string;

BEGIN
i:=0;
total:=0;
max:=0;

{Program Block}

min:=1000;
maxhouse:='';
minhouse:='';
for i:= 1 to 4 do
begin
house[i]:='';
hpt[i]:=0;
end;
Candidate Name: Amilla Morille
Candidates Registration Number: 1400100922
Centre Number: 140010

For i:= 1 to 4 do
begin
write('Enter the house name');
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 which
is larger than 0');
readln(hpt[i]);
writeln;
until hpt[i] > 0;

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

For i:= 1 to 4 do
begin
Candidate Name: Amilla Morille
Candidates Registration Number: 1400100922
Centre Number: 140010

If hpt[i]> max then


begin
max:= hpt[i];
maxhouse:= house[i];
end;

If hpt[i]< min then


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

writeln;
writeln('The victorious house was ',maxhouse);
writeln('Victorious house points: ',max);
writeln('The trailing house was ',minhouse);
writeln('The lowest score was ',min);
writeln('The total house points was: ',total);

END.

{Program Terminator}
Candidate Name: Amilla Morille
Candidates Registration Number: 1400100922
Centre Number: 140010

minValue:99999;
maxValue:=0;
maxhouse:='';
minhouse:='';
For i:= 1 to 4 do
begin
write('Enter the house name');
readln(house[i]);

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


readln(hpt[i]);
writeln;

total:=total + hpt[i];
end;
//comment: the above stored all the values and calculated totals.
//below is find highest and lowest values
For i:= 1 to 4 do
begin
readln(hpt[i]);
If hpt[i]> maxValue then
Candidate Name: Amilla Morille
Candidates Registration Number: 1400100922
Centre Number: 140010

begin
maxValue:= hpt[i];
maxhouse:= house[i];
end;
If hpt[i]< minValue then
begin
minValue:= hpt[i];
minhouse:= house[i];

end;
writeln('The victorious house was ',maxhouse);
writeln('Victorious house points: ',maxValue);
writeln('The trailing house was ',minhouse);
writeln('The lowest score was ',minValue);
writeln('The total house points was: ',total);
END

Candidate Name: Amilla Morille


Candidates Registration Number: 1400100922
Centre Number: 140010

S-ar putea să vă placă și