正在加载图片...
SA.1 ARRAYS 1166.1 copy,is_equal, consistent,setup end; TO SPECIAL [G] export (ARRAY)set area redefine copy,is_equal, consistent,setup end creation make feature--Initialization make (minindex,maxindex:INTEGER)is --Allocate array;set index interval to --'minindex'..'maxindex';set all values to default. --(Make array empty if'minindex'='maxindex'+1). require valid indices:minindex <maxindex or (minindex maxindex 1) do lower:=minindex; upper :maxindex; if minindex <maxindex then make area (maxindex-minindex +1) else make area(0)§A.1 ARRAYS 1166.1 copy, is_equal, consistent, setup end; TO_SPECIAL [G] export {ARRAY} set_area redefine copy, is_equal, consistent, setup end creation make feature -- Initialization make (minindex, maxindex: INTEGER) is -- Allocate array; set index interval to -- `minindex’ .. `maxindex’; set all values to default. -- (Make array empty if `minindex’ = `maxindex’ + 1). require valid_indices: minindex <= maxindex or (minindex = maxindex + 1) do lower := minindex; upper := maxindex; if minindex <= maxindex then make_area (maxindex - minindex + 1) else make_area (0)
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有