Eiffel Flashcards

(15 cards)

1
Q

Who developed Eiffel?

A

Dr. Bertrand Meyer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Eiffel’s programming language paradigm?

A

Object-Oriented
Programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

This term is used to refer to attributes, methods/routines or
components of a class?

A

Features

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A collection of classes or source code files in the same directory?

A

Cluster

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The keyword used to implement a multi-way selection statement
(like switch)?

A

Inspect

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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).

A

FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The modern EiffelStudio IDE is predominantly used on Windows
(x86/x64) architecture. It uses “Melting Ice” technology to allow
rapid compilation on personal computers.

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Eiffel does not have return statements and uses a Result variable
instead to store the return value.

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In order to separate routine parameters, you use a semicolon (;)

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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.

A

FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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))

A

15 (5 + 5 = 10, then 10 + 5 = 15. The Result variable holds the accumulating
value).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the text displayed on the screen?

feature
make_sentence
local
word: STRING
do
word := “Eiffel”
word.append(“ Tower”)
print(word)
end
end

A

Eiffel Tower (The append feature modifies the string in place).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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

A

Lesser (10 is not greater than 20).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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)

A

B (The value 85 falls inside the range 80..89).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

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”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly