Final answer:
Here is a function definition for the getNumber function that prompts the user to enter a number in the range of 1-100 and stores the validated input in a reference parameter.
Step-by-step explanation:
getNumber Function Definition
Here is the function definition for the getNumber function:
def getNumber(num: int) -> None:
while True:
try:
num = int(input('Enter a number in the range of 1-100: '))
if num<1 or num>100:
raise ValueError
break
except ValueError:
print('Invalid input. Please enter a number between 1 and 100.')
This function uses a reference parameter num to accept an integer argument. It prompts the user to enter a number in the range of 1-100 and continuously validates the input until a valid number is entered. The validated number is then stored in the num parameter variable.