nerdexam
Oracle

1Z0-147 · Question #43

Examine this package: CREATE OR REPLACE PACKAGE discounts IS g_id_number := 7829; g_discount_rate NUMBER := 0.00; PROCEDURE display_price (p_price NUMBER); END discounts; / CREATE OR REPLACE PACKAGE…

The correct answer is A. A. Discounted 10. See the full explanation below for the reasoning.

Question

Examine this package: CREATE OR REPLACE PACKAGE discounts IS g_id_number := 7829; g_discount_rate NUMBER := 0.00; PROCEDURE display_price (p_price NUMBER); END discounts; / CREATE OR REPLACE PACKAGE BODY discounts IS PROCEDURE display_price (p_price NUMBER) IS BEGIN DBMS_OUTPUT.PUT_LINE ('Discounted ' || TO_CHAR(p_priceNVL(discount_rate, 1))); END display_price; BEGIN discount_rate := 0.10; END discounts; / The SQLPlus SERVEROUTPUT setting is turned on in your session. You execute the procedure DISPLAY_PRICE from SQL*Plus with the command: EXECUTE discounts.display_price (100); What is the result?

Options

  • AA. Discounted 10
  • BB. Discounted 100
  • CC. Discounted 0.00
  • DD. Discounted NULL
  • EE. Discounted 0.10

How the community answered

(28 responses)
  • A
    75% (21)
  • B
    7% (2)
  • C
    14% (4)
  • E
    4% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-147 Practice