In: Computer Science
For the following problem, draw a flowchart, write a function and then execute the function with your choice of input parameter values:
For given two input parameters: If parameter 1 is smaller than parameter 2 return the remainder of parameter 1 by parameter 2 Otherwise, return the multiplication of two input parameters.
Python programming language
Python code, Attached screen shots at the end
----CODE START----
def sampleFunction():
#Ask user to parameter 1 and parameter 2
print("Enter Parameter 1 value: ")
param1 = int(input())
print("Enter Parameter 2 value: ")
param2 = int(input())
#Check if param1 < param2
if(param1 < param2):
return param1%param2 #Return reminder if true
else:
return param1*param2
if __name__ == "__main__":
return_val = sampleFunction()
print(return_val)
----CODE END----