Delphi Programming: Self-Review 02

What Delphi control would you use to output Fibonacci numbers or prime numbers?

Answer: ListBox

What function would you use to display the number 1.567 in a ListBox or a Showmessage?

Answer: FloatToStr()

What sort of expression follows 'if'?

Answer: Booelan expression

Which of the following is not a Boolean operator: =, >, <, :=, not, >=, <=, <>?

Answer: := - assignment

What structure is used in Delphi to hold the code for an event such as clicking on a button?

Answer: a procedure

What structure is used to return a single value of a specified type?

Answer: a function

What structure is used to repeat something a specified number of times?

Answer: a for loop

What structure would you use if a number of possible outcomes were dependent on a variable of type integer or char?

Answer: case x of...

What structure would you use if you wanted a loop to run at least once?

Answer: repeat..until (condition after the actions)

What structure would you use if there was a chance a loop should not be run at all?

Answer: while..do (condition before the actions

Back to Delphi Tutorial