Algorithm : Totals | ||||||||||||||||||||||||||||||||||||||||||||||
If a sequence of numeric items is to be input and added up then a variable is used for the total and this will need to be initialised to 0. Example 10 marks are to be input and added together. A variable called total will be used to store the added marks. Each time a mark is input, it is added to the total. The pseudocode algorithm will be...
|
||||||||||||||||||||||||||||||||||||||||||||||
Another example (combining rogue value, count and total) Marks are to be input terminated by a rogue value of -99. The average of the marks is to be calculated. The pseudocode algorithm for this problem would be..
Note : Pseudocode is not rigorous - I
have put instead of This is not important as
long as
|
||||||||||||||||||||||||||||||||||||||||||||||