Answer:
Here are the stub functions get_user_num() and compute_avg()
def get_user_num():
print('FIXME: Finish get_user_num()')
return -1
def compute_avg(user_num1, user_num2):
print('FIXME: Finish compute_avg()')
return -1
Step-by-step explanation:
A stub is a small function or a piece of code which is sometimes used in program to test a function before its fully implemented. It can also be used for a longer program that is to be loaded later. It is also used for a long function or program that is remotely located. It is used to test or simulate the functionality of the program.
The first stub for the function get_user_num() displays FIXME: Finish get_user_num() and then it returns -1.
The seconds stub for the function compute_avg() displays the FIXME: Finish compute_avg() and then it returns -1.
Here with each print statement, there is function name after this FIXME: Finish line. The first function name is get_user_num and the second is compute_avg().
Next the function get_user_num() is called twice and function compute_avg() followed by a print statement: print('Avg:', avg_result) which prints the result. So the program as a whole is given below:
def get_user_num():
print('FIXME: Finish get_user_num()')
return -1
def compute_avg(user_num1, user_num2):
print('FIXME: Finish compute_avg()')
return -1
user_num1 = 0 # the variables are initialized to 0
user_num2 = 0
avg_result = 0
user_num1 = get_user_num() #calls get_user_num method
user_num2 = get_user_num()
avg_result = compute_avg(user_num1, user_num2)
print('Avg:', avg_result)
The method get_user_num() is called twice so the line FIXME: Finish get_user_num() is printed twice on the output screen. The method compute_avg() is called once in this statement avg_result = compute_avg(user_num1, user_num2) so the line FIXME: Finish compute_avg() is printed once on the output screen. Next the statement print('Avg:', avg_result) displays Avg: -1. You can see in the above program that avg_result = compute_avg(user_num1, user_num2) and compute_avg function returns -1 so Avg= -1. The program along with the produced outcome is attached.