Complete the code to declare a function named add that returns an integer.
function add(a : integer; b : integer) return [1] is begin return a + b; end function;
The function add returns an integer type, matching the input types and the expected output.
Complete the code to call the function multiply with arguments 3 and 4.
result := multiply([1], 4);
The function multiply is called with the first argument as 3 and the second as 4.
Fix the error in the function declaration by completing the return type.
function is_even(n : integer) return [1] is begin if (n mod 2) = 0 then return true; else return false; end if; end function;
The function is_even returns a boolean value because it returns true or false.
Fill both blanks to create a function that returns the absolute value of an integer.
function abs_val(x : integer) return [1] is begin if x [2] 0 then return -x; else return x; end if; end function;
The function returns an integer. The condition checks if x < 0 to return the negative value.
Fill all three blanks to create a function that returns a new integer by adding 10 to the input.
function add_ten(num : integer) return [1] is begin return num [2] [3]; end function;
The function returns an integer. It adds 10 to num using the + operator.
