Summer Special Limited Time 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 8w52ceb345

Below is pseudo-code which calculates a customer's cruise credits based on past cruise history:PROGRAM CALC...

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

CTAL-TTA PDF/Engine
  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions
buy now CTAL-TTA pdf
Get 60% Discount on All Products, Use Coupon: "8w52ceb345"