Fibonacci Sequence - Eiffel Typing CST Test
Loading…
Fibonacci Sequence — Eiffel Code
Generates first 10 Fibonacci numbers.
class
FIBONACCI
feature
compute
do
local a, b, c, i: INTEGER
a := 0
b := 1
io.put_integer(a); io.put_new_line
io.put_integer(b); io.put_new_line
from i := 1 until i > 8 loop
c := a + b
io.put_integer(c); io.put_new_line
a := b
b := c
i := i + 1
end
end
end
! Run
local
f: FIBONACCI
do
create f
f.compute
endEiffel Language Guide
Eiffel is a high-level, object-oriented programming language designed for software engineering with a strong emphasis on correctness, reusability, and maintainability. It supports the Design by Contract methodology, promoting robust and reliable applications.
Primary Use Cases
- ▸High-reliability enterprise software
- ▸Safety-critical systems
- ▸Reusable component libraries
- ▸Formal software engineering projects
- ▸Educational use for software engineering principles
Notable Features
- ▸Design by Contract
- ▸Strong static typing
- ▸Generic classes and collections
- ▸Multiple inheritance with controlled resolution
- ▸Automatic memory management (garbage collection)
Origin & Creator
Eiffel was created by Bertrand Meyer in the late 1980s at ETH Zurich and later developed further at Interactive Software Engineering.
Industrial Note
Eiffel is used in safety-critical systems, mission-critical enterprise applications, embedded systems requiring high reliability, and software frameworks emphasizing correctness.