-- Name Ann Onymous -- Does analyse Big stat data (without arrays) Box num ofType int ---- number of values Box sum ofType int ---- sum of all values Box val ofType int ---- the value entered Box wet ofType int ---- number of wet days Box len ofType int ---- length of dry run Box most ofType int ---- the maximum value Box mean ofType real --- mean of all values Box maxLen ofType int --- max len of dry run Box minRain ofType int -- second min rain -- Setup Set sum = 0 Set num = 0 Set wet = 0 Set len = 0 Set most = 0 Set maxLen = 0 Set minRain = 1000 -- Big min Outputln "Enter values; end with negative" -- Compute one big loop Repeat Input val ExitOn (val < 0) Outputln val -- Accumulate Set sum = sum + val -- Count Set num = num + 1 If (val > 0) then Inc wet by 1 EndIf -- Find nonzero min rain If (val > 0) then If (minRain > val) then Set minRain = val EndIf EndIf -- Select extremes Set most = Math.max (most, val) -- Get length of dry run If (val == 0) then Inc len by 1 If (maxLen < len) then Set maxLen = len EndIf Else Set len = 0 EndIf EndRepeat -- Report of results Output "Number of days is " Outputln num Output "Total rain amount is " Outputln sum Output "Mean rainfall is " Set mean = IntToReal(sum) / IntToReal (num) Outputln mean Output "Length of longest run of dry days is " Outputln maxLen Output "Maximum rain in a day is " Outputln most Output "Minimum rain that fell is " Outputln minRain Outputln " " -- gap Enter values; end with negative 3 0 0 0 2 0 0 Number of days is 7 Total rain amount is 5 Mean rainfall is 0.7142857142857143 Length of longest run of dry days is 3 Minimum rain that fell is 2