Question: CODE IN PYTHON PLEASE (.PY) 3. Problem Specification: Design and implement a modularised program that does not use any return of values. def main() is

CODE IN PYTHON PLEASE (.PY)

CODE IN PYTHON PLEASE (.PY) 3. Problem Specification: Design and implement amodularised program that does not use any return of values. def main()is to call two functions (names at your discretion) function-01 0 function-020There is no menu in def main() In addition in def main

3. Problem Specification: Design and implement a modularised program that does not use any return of values. def main() is to call two functions (names at your discretion) function-01 0 function-020 There is no menu in def main() In addition in def main (): Initialise a list to be passed to function-02 Prompt for a number to be passed to function-02 After function-02 executes and returns control to def main(), print the list that was passed as argument to function-02. The assessment requires in-line commentary explaining what has happened to the list. function-01 is to be called with no arguments from def main() function-02 is to be called with arguments immediately after function-01() completes 3.1 function-01 is a pet-age calculator: In def main() call function-01 with no arguments In function-01: No validation is required for the menu Present a menu local to the function with prompts: Animal Menu 1. Cat Age 2. Dog Age 3. Exit Option-1: No validation is required References the cat age calculator only for Junior (input is integer in months) and Prime (input is integer in years). Input integer for age of a cat Output the human age (preferably use a formula) Control passes back to the Animal Menu with no return of any values Option-2: Validation required Input integer for age of a dog age Validate the input range o Minimum age = 3 years, maximum age = 20 years; Output the human age: Use 22+(dogAge-2)*5 Control passes back to the Animal Menu with no return of any values Option-3: Return to def main() with no return of any values 3.2 function-02 is a memory game: In def main() immediately after execution of function-01call function-02 with two arguments The arguments are initialised in def main(): Initialise a list with integers 1 to 5 as content; Prompt to input a number for the number of seconds to use Suggestion: Use 0.5 or 1 or 2 or 3 No validation required (You will see larger numbers will be frustrating) Call function-02 with the list and the integer as arguments; In function-020: function-02 should receive the arguments as aliases; function-02 is to populate the original list with a set of five random numbers in the range 1 to 5. These five random integers will display on screen for the given number of seconds and then will disappear. The game is for the user to memorise the numbers before they disappear no input is required (assume they will put their answer on paper). When the numbers have disappeared off the screen, give the user a message to press return so they can see them again (i.e. they can check their answer), e.g. i) Display 5 random integers (1 to 5) for the given number of seconds; ii) Clear the screen of the integers iii) Allow user to press Return to see the numbers again to check their answer. Return to def main() function-02 NOTES: Assessment looks for evidence of background work being applied to the solution: The function requires: import random to generate the random numbers in the list import time to set the number of seconds the list will be displayed on screen import os to enable the screen to be cleared of the list Research the functions required from these modules to enable function-02 to work correctly. 3.3 In def main(): When function-02 returns execution to def main(): print out the original list that was passed as argument to function-02 print out the number of seconds that was passed to function-02 Use in-line commentary (one or two sentences) to explain what has happened to the two arguments and why. Program ends

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!