Valid CTAL-TTA Dumps shared by ExamDiscuss.com for Helping Passing CTAL-TTA Exam! ExamDiscuss.com now offer the newest CTAL-TTA exam dumps, the ExamDiscuss.com CTAL-TTA exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com CTAL-TTA dumps with Test Engine here:
Below is pseudo-code which calculates a customer's cruise credits based on past cruise history: PROGRAM CALC CRUISE CREDITS (CUST_ID) COUNT_CRUISES, CRUISE_CREDITS, LOYALTY_RATING: INTEGER CRUISE_LENGTH, CRUISE_ACCOM_TYPE: VAR * LOYALTY_RATING = 0 * COUNT_CRUISES = 0 * CRUISE_LENGTH = 0 * CRUISE_ACCOM_TYPE = 0 * BEGIN * READ CUSTOMER'S CRUISE HISTORY TO OBTAIN COUNT OF CRUISES * READ CRUISE_HISTORY (CUST_ID) * WHILE COUNT_CRUISES != -1 DO * READ CUSTOMER'S NEXT CRUISE * READ NEXT_CRUISE * IF CRUISE_ACCOM_TYPE = 3 THEN * CRUISE_CREDITS = CRUISE_CREDITS + 5 * ELSE * IF CRUISE_ACCOM_TYPE = 2 THEN * CRUISE_CREDITS = CRUISE_CREDITS + 3 * ELSE * CRUISE_CREDITS = CRUISE_CREDITS + 2 * ENDIF * ENDIF * COUNT_CRUISES = COUNT_CRUISES - 1 * ENDWHILE * LOYALTY_RATING = CRUISE_CREDITS / COUNT_CRUISES * WRITE ("CRUISE CREDIT TOTAL IS:") * WRITE (CRUISE_CREDITS) * END PROGRAM CALC CRUISE CREDITS The code contains data flow anomalies on lines 14 and 27. Which examples of data flow anomalies can be found on these lines?
Correct Answer: C
In the pseudo-code provided, we need to identify data flow anomalies, which typically occur when variables are used improperly in terms of their definition, usage, or re-definition. Analyzing the pseudo-code step by step: * Lines 1-4 initialize variables LOYALTY_RATING, COUNT_CRUISES, CRUISE_LENGTH, and CRUISE_ACCOM_TYPE to 0. * Lines 6-7 read the customer's cruise history. * Line 8 begins a WHILE loop that continues until COUNT_CRUISES is -1. * Lines 9-10 read the next cruise. * Lines 11-19 check the CRUISE_ACCOM_TYPE and update CRUISE_CREDITS accordingly. * Line 20 decrements COUNT_CRUISES. * Line 21 ends the WHILE loop. * Line 22 calculates LOYALTY_RATING by dividing CRUISE_CREDITS by COUNT_CRUISES. * Lines 23-24 output the CRUISE_CREDITS. * Line 25 ends the program. Data Flow Anomalies: * Line 14: CRUISE_CREDITS is re-defined before being used. * The initial problem here is that CRUISE_CREDITS should be assigned a value before it is incremented in lines 12, 15, and 17. The code does not show any prior definition (initialization) for CRUISE_CREDITS before these increments. * Line 27: LOYALTY_RATING is defined but not subsequently used. * After LOYALTY_RATING is calculated in line 22, it is not used again. This means the calculated value serves no purpose in the program as it stands. By considering the above points, we can confirm that the correct option is C: * Line 14: CRUISE_CREDITS is re-defined before being used (it should have been initialized before the WHILE loop or just before its first usage inside the loop). * Line 27 (Line 22 in provided pseudo-code): LOYALTY_RATING is defined (calculated) but not subsequently used. This matches the reference provided in the ISTQB sample exam answers, confirming that C is the correct answer. References: * ISTQB CTAL-TTA Sample Exam Questions * ISTQB Exam Structures and Rules * ISTQB CTAL-TTA Sample Exam Answers * ISTQB-CTAL-TTA Syllabus * ISTQB Exam Structure Tables