Question: Please complete the following program by building functions around the existing code in the blanks provided. You MAY NOT otherwise modify the existing code. Create


Please complete the following program by building functions around the existing code in the blanks provided. You MAY NOT otherwise modify the existing code. Create the following functions to determine if the user has correctly guessed the amount of jelly beans in the jar: a) get_amt: Determines and returns the user's name and guess allowing the user to guess again when the first guess is close but incorrect b) game_over: Determines and returns an appropriate message indicating whether the user's guess was correct Lastly, complete the main function. The main function calls all of the other functions so that they work properly together. Some code is provided. The screenshots included demonstrate how the program should work. What is your name? david David, enter your guess: 82 Close! Try again: 79 79 was correct. David, you won! What is your name? jenna Jenna, enter your guess: 16 Sorry Jenna! Maybe next time... When finished, this entire program should run successfully if it were typed into Wing. def total): msg = "Sorry + person + "! Maybe next time..." if (guess == total): msg = str(total) was correct. " + person + ", you won!" return msg - def (top player = input ("What is your name? ").title() num = int(input (player + ", enter your guess: ")) if (num >= bottom) and (num
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
