Who developed Eiffel?
Dr. Bertrand Meyer
What is Eiffel’s programming language paradigm?
Object-Oriented
Programming
This term is used to refer to attributes, methods/routines or
components of a class?
Features
A collection of classes or source code files in the same directory?
Cluster
The keyword used to implement a multi-way selection statement
(like switch)?
Inspect
Eiffel wasn’t designed simply to be a coding tool but more like a
comprehensive environment for applying the principles of Simple
Concurrent Object-Oriented Programming (SCOOP).
FALSE
The modern EiffelStudio IDE is predominantly used on Windows
(x86/x64) architecture. It uses “Melting Ice” technology to allow
rapid compilation on personal computers.
TRUE
Eiffel does not have return statements and uses a Result variable
instead to store the return value.
TRUE
In order to separate routine parameters, you use a semicolon (;)
TRUE
Eiffel uses a rescue and redefine mechanism rather than try-catch.
This is designed to restore the object’s invariant (valid state) rather
than just suppressing the error.
FALSE
What is the final output?
feature
calculate_sum (a, b: INTEGER): INTEGER
do
Result := a + b
Result := Result + 5
end
end
– Call:
print(calculate_sum(5, 5))
15 (5 + 5 = 10, then 10 + 5 = 15. The Result variable holds the accumulating
value).
What is the text displayed on the screen?
feature
make_sentence
local
word: STRING
do
word := “Eiffel”
word.append(“ Tower”)
print(word)
end
end
Eiffel Tower (The append feature modifies the string in place).
What is the output?
feature
check_value
local
x: INTEGER
do
x := 10
if x > 20 then
print(“Greater”)
else
print(“Lesser”)
end
end
end
Lesser (10 is not greater than 20).
What letter is printed?
feature
evaluate_grade (grade: INTEGER)
do
inspect grade
when 90..100 then
print(“A”)
when 80..89 then
print(“B”)
else
print(“Fail”)
end
end
end
– Call:
evaluate_grade(85)
B (The value 85 falls inside the range 80..89).
What is the output?
feature
tricky_loop
local
i: INTEGER
do
from
i := 10
until
i > 5 – Termination condition
loop
print(i)
i := i - 1
end
print(“Done”)
end
end
Done
○ In Eiffel, until defines the termination condition (stop when true), not a
“while” condition. Since i starts at 10, and 10 > 5 is True immediately, the
loop body never executes. It skips straight to printing “Done”.