Reference no: EM132330229
Question
Below is a program that's incomplete. complete the program with the following tasks. See the comments inserted in the program to guide on what to do.
Design a program to input three numbers from the user, find the largest of the three numbers, and display the three numbers along with the largest numbers. You cannot change any of the existing code provided, can just add to it.
1. Add the code for three functions:
1. get_input( ): This function will input a number and return it. The function will be called three times in main( ) to input three numbers.
2. find_largest( ):Enter the parameters for the function find_largest( ). The parameters will be the three numbers that were part of the input process in main( ). These numbers will be passed to find_largest. Write the code for find_largest( ) to find the largest of the three numbers.
3. display_results( ): This function will display the three numbers entered and will display the largest of the three. All four numbers will need to be passed in as parameters. Use appropriate labels and spacing for the output.
2. Add the function calls as listed in the attached file
def main():
# Please see the comments
largest = 0
#insert call to function get_input() after the = sign on the following three lines
number1 =
number2 =
number3 =
# insert call to function find_largest after this comment.
# find_largest will take in three parameters and will return the largest of the 3 numbers
#Insert the statement to display the three numbers entered and the largest number after this comment.
#The print statements will be in a function named display_results()
def find_largest( ):
# insert parameters in the parenthesis
# Write the code for this function here.
# find_largest will take in three parameters and will return the largest of the 3 numbers
# These three numbers are passed in as parameters from the main function
# Hint: if and elif - no loop needed here
def get_input():
#insert a statement to input a number
#return this number out of this function
def display_results():
#this function will display the three numbers and the largest of the three
#the three numbers and the largest number will be passed into this function as parameters main() # this is the call to main() that will make the program run