Last active
October 7, 2016 20:18
-
-
Save jasarsoft/f1669097fcff3d8f302b7b5da6ba71d4 to your computer and use it in GitHub Desktop.
The school example of calculating the average score using the Pascal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{*******************************************************************} | |
{ } | |
{ Borland Turbo Pascal 1.5 for Windows } | |
{ Thursday, 9. December 2010 } | |
{ Copyright(c) by Edin Jašarević } | |
{ [email protected] } | |
{ } | |
{*******************************************************************} | |
Program CoculateAvarage (Input, OutPut); | |
Uses WinCrt; | |
Const NUMBER_SUBJECT=16; | |
Type mark=array[1..NUMBER_SUBJECT] Of Integer; | |
Var rating:mark; | |
i, sum:Integer; | |
avarage:Real; | |
Begin | |
For i:=1 To NUMBER_SUBJECT Do Begin | |
Write ('Rating: '); | |
Readln (rating[i]); | |
sum:=0; | |
i:=1; | |
While i<=NUMBER_SUBJECT Do Begin | |
sum:=sum+rating[i]; | |
i:=i+1; | |
end | |
end; | |
avarage :=sum/NUMBER_SUBJECT; | |
Writeln ('Avarage: ',avarage:6:2); | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment