Create a new method in your language called Times Print. This should be a void method. It should accept exactly two numeric values as input, X and Y. Inside the body, it should display text like, "The value of X times Y is Z," where Z=X*Y. It should accomplish no other tasks inside the body. Call this method inside your main (or equivalent starting point) three times, each with different inputs. Check that the program runs and the output matches what you expect. Embed screenshots of the code and the program running.

Respuesta :

Answer:

The code commented is given below, also the lines that start with # are comments that explains the code.

# Create a function named times_print that receives 2 values x and y

def times_print(x, y):

   # Print the formatted string

   print("The value of {} times {} is {}".format(x,y,x*y))

# Create the main function

def main():

   # Call the funciton times_print 3 times with different values

   times_print(2,3)

   times_print(4,5)

   times_print(5,6)

# Execute the main function

main()

Explanation:

The code was written using Python 3.5, and here I attach the screenshots of the program running:

Ver imagen jf23perez
Ver imagen jf23perez