-- Create a package specification CREATE OR REPLACE PACKAGE pk1 AS PROCEDURE proc1(num1 IN NUMBER, num2 IN NUMBER, sum OUT NUMBER, avg OUT NUMBER, prod OUT NUMBER); PROCEDURE proc2(num IN NUMBER, sqrt_result OUT NUMBER); FUNCTION fn11(num IN NUMBER) RETURN BOOLEAN; FUNCTION fn22(num1 IN NUMBER, num2 IN NUMBER, num3 IN NUMBER) RETURN NUMBER; END pk1; / -- Create a package body CREATE OR REPLACE PACKAGE BODY pk1 AS PROCEDURE proc1(num1 IN NUMBER, num2 IN NUMBER, sum OUT NUMBER, avg OUT NUMBER, prod OUT NUMBER) IS BEGIN sum := num1 + num2; avg := (num1 + num2) / 2; prod := num1 * num2; END proc1; PROCEDURE proc2(num IN NUMBER, sqrt_result OUT NUMBER) IS BEGIN sqrt_result := SQRT(num); END proc2; FUNCTION fn11(num IN NUMBER) RETURN BOOLEAN IS BEGIN RETURN MOD(num, 2) = 0; END fn11; FUNCTION fn22(num1 IN NUMBER, num2 IN NUMBER, num3 IN NUMBER) RETURN NUMBER IS BEGIN RETURN num1 + num2 + num3; END fn22; END pk1; / -- Example of using the package in a PL/SQL program DECLARE num1 NUMBER := &num1; -- Prompt for user input num2 NUMBER := &num2; -- Prompt for user input num3 NUMBER := &num3; -- Prompt for user input result_sum NUMBER; result_avg NUMBER; result_prod NUMBER; result_sqrt NUMBER; result_fn11 BOOLEAN; result_fn22 NUMBER; BEGIN pk1.proc1(num1, num2, result_sum, result_avg, result_prod); pk1.proc2(num1, result_sqrt); result_fn11 := pk1.fn11(num1); result_fn22 := pk1.fn22(num1, num2, num3); DBMS_OUTPUT.PUT_LINE('Sum: ' || result_sum); DBMS_OUTPUT.PUT_LINE('Average: ' || result_avg); DBMS_OUTPUT.PUT_LINE('Product: ' || result_prod); DBMS_OUTPUT.PUT_LINE('Square Root: ' || result_sqrt); DBMS_OUTPUT.PUT_LINE('Is ' || num1 || ' even? ' || CASE WHEN result_fn11 THEN 'Yes' ELSE 'No' END); DBMS_OUTPUT.PUT_LINE('Sum of three numbers: ' || result_fn22); END; /