summaryrefslogtreecommitdiffstats
path: root/eiffel-fragen/nachbedingung/counter.e
diff options
context:
space:
mode:
Diffstat (limited to 'eiffel-fragen/nachbedingung/counter.e')
-rw-r--r--eiffel-fragen/nachbedingung/counter.e30
1 files changed, 30 insertions, 0 deletions
diff --git a/eiffel-fragen/nachbedingung/counter.e b/eiffel-fragen/nachbedingung/counter.e
new file mode 100644
index 0000000..db93ce7
--- /dev/null
+++ b/eiffel-fragen/nachbedingung/counter.e
@@ -0,0 +1,30 @@
1class
2 COUNTER
3
4feature -- Access
5
6 item: INTEGER
7 -- Counter's value.
8
9feature -- Element change
10
11 set (some_value: INTEGER) is
12 -- Set value of counter to some_value.
13 do
14 item := some_value
15 ensure
16 checkval > 0
17 end
18
19 get: INTEGER is
20 -- Get value of counter
21 do
22 Result := item
23 end
24
25 checkval: INTEGER is
26 -- Get value of counter
27 do
28 Result := item
29 end
30end