New Year Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: simple70

ISTQB Certified Tester Advanced Level Technical Test Analyst CTAL-TTA Question # 21 Topic 3 Discussion

ISTQB Certified Tester Advanced Level Technical Test Analyst CTAL-TTA Question # 21 Topic 3 Discussion

CTAL-TTA Exam Topic 3 Question 21 Discussion:
Question #: 21
Topic #: 3

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?


A.

Line 14: Cruise_Credits is not assigned a value (defined) before being used Line 27: Loyalty_Rating is defined but not subsequently used


B.

Line 14: Cruise_Credits is defined but not subsequently used Line 27: Loyalty_Rating is not assigned a value (defined) before being used


C.

Line 14: Cruise_Credits is re-defined before being used Line 27: Loyalty_Rating is defined but not subsequently used


D.

Line 14: Cruise_Credits should not be declared as an integer Line 27: Loyalty_Rating should be calculated within the While loop


Get Premium CTAL-TTA Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.