Ch.22 Algorithm Design I - Assignment - Ans

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

NLSI Lui Kwok Pat Fong College

Information and Communication Technology (ICT) Ch.22 Algorithm Design (I)

Assignment

1. Which of the following statement(s) is/are correct?


(1) An algorithm contains an infinite sequence of steps.
(2) An algorithm is used to generate a solution of a problem.
(3) In an algorithm, the steps are organized in a specific logical order.

A. (2) only
B. (1) and (3) only
C. (2) and (3) only
D. (1), (2) and (3)

2. Which of the following is/are used to describe an algorithm in a narrative form?

A. Flowchart
B. Pseudocode
C. Both flowchart and pseudocode
D. None of the above

3. Which of the following symbols is used to represent a decision in a flowchart?

A.

B.

C.

D.

4. What does the following flowchart symbol represent?

A. Input
B. Process
C. Connector
D. Predefined process

1
NLSI Lui Kwok Pat Fong College
Information and Communication Technology (ICT) Ch.22 Algorithm Design (I)
5. Which of the following should be taken into consideration when constructing a user
interface?
(1) Form field validation
(2) Consistency in the interface
(3) Appropriate placement of different elements on the interface

A. (2) only
B. (1) and (2) only
C. (1) and (3) only
D. (1), (2) and (3)

6. Which of the following is not a data type?

A. Integer
B. Real
C. Variable
D. Character

7. Which of the following statements is/are correct?


(1) A constant is a value that can be changed twice during the execution of a
program.
(2) Variable is a value that cannot be changed during the execution of a
program.
(3) We have to give a name to a variable before using it in a program.

A. (1) only
B. (2) only
C. (3) only
D. (1), (2) and (3)

8. Which of the following can be used to store the name of a person?

A. Character
B. Boolean
C. Real
D. String

9. Which of the following is not a good user interface design?

A. Use black background with brown fonts to display the content.


B. Perform form field validation after a form is submitted.
C. Use radio buttons and drop-down selection boxes to control objects appropriately.
D. Use the same colour scheme and similar wordings for labels and text on all forms of
the interface.

2
NLSI Lui Kwok Pat Fong College
Information and Communication Technology (ICT) Ch.22 Algorithm Design (I)
10. Which of the following statements is not correct?

A. An integer can be used in calculations.


B. A character can be used to store a digit.
C. A string is a collection of characters.
D. An array is a collection of variables of different data types.

11. Which of the following logical operations matches with the truth table below?
p q Result
True True True
True False False
False True False
False False False

A. p AND q
B. p OR q
C. NOT p
D. None of the above

12. Which of the following logical operations matches with the truth table below?
p q Result
True True False
True False False
False True True
False False True

A. p AND q
B. p OR q
C. NOT p
D. None of the above

13. Which of the following may be included in the input requirements of a problem?
(1) Data types
(2) Precision levels
(3) Units

A. (1) only
B. (2) only
C. (2) and (3) only
D. (1), (2) and (3)

3
NLSI Lui Kwok Pat Fong College
Information and Communication Technology (ICT) Ch.22 Algorithm Design (I)
14. Given that x = 10 and y = 20, which of the following logical expressions is true?

A. x > 20
B. (y < 40) AND (x < 5)
C. (x + y) < 40
D. (x – y) > 0

15. Given that x = 10 and y = 20, which of the following shows the output of the
pseudocode below?

Input x, y
IF x > 20 THEN
TEMP ß x * x
ELSE
TEMP ß x + x
ENDIF
IF y > 10 THEN
TEMP ß TEMP - y
ELSE
TEMP ß TEMP * y
ENDIF
Output TEMP

A. 0
B. 80
C. 400
D. 2,000

16. Which of the following is not the key consideration when designing the layout of a
user interface?

A. Appropriate use of colours


B. Consistent alignment of fields
C. Concise and appropriate use of wording
D. Use animated GIF

17. Which of the following data types can be used to store logical data?

A. integer
B. real
C. character
D. Boolean

4
NLSI Lui Kwok Pat Fong College
Information and Communication Technology (ICT) Ch.22 Algorithm Design (I)
18. Find the results of the following logical expressions.
(1) 10 > 2
(2) NOT (10 > 2)
(3) (10 > 2) AND NOT (10 > 2)

(1) (2) (3)


A. TRUE FALSE TRUE
B. TRUE FALSE FALSE
C. FALSE TRUE TURE
D. TRUE TRUE FALSE

19. Suggest an appropriate data type for the age of a student.

A. integer
B. real
C. character
D. Boolean

20. Suggest an appropriate data type for a short message.

A. real
B. string
C. character
D. Boolean

You might also like