ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 45 - CTAL-TTA discussion

Report
Export

Below is the pseudo-code for the Win program:

The bingo program contains a data flow anomaly. Which data flow anomaly can be found in this program?

A.
Variable 'A' is not assigned a value before using it.
Answers
A.
Variable 'A' is not assigned a value before using it.
B.
Variable 'D' is defined but subsequently not used.
Answers
B.
Variable 'D' is defined but subsequently not used.
C.
The program does not contain any comments.
Answers
C.
The program does not contain any comments.
D.
It is recommended to use a variable instead of the hard-coded print results 'Win' and *Loose'.
Answers
D.
It is recommended to use a variable instead of the hard-coded print results 'Win' and *Loose'.
Suggested answer: B

Explanation:

The pseudo-code provided for the 'Win' program reads in variables A, B, C, and D. However, only variables A, B, and C are used in the conditional statements to determine if the output will be 'Win' or 'Loose'. Variable 'D' is never used after it is read, which is a classic example of a 'defined but not used' data flow anomaly. This means that while there is an instruction to read a value into variable 'D', there is no subsequent use of this variable in the program's logic or output.

asked 18/09/2024
July Truong
38 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first