vendredi 25 septembre 2020

Menu Driven Program using Functions

I am trying to interpret what my professor is requesting. Below is the criteria that I need to have. The way I read this is that I need to create a function that saves the users name and generates a random number saved in a different list for that name. Be able to print both lists with one function or print a single name with the random number all in a menu format. Does anyone interpret the instructions differently?

You are to create a menu driven program that has the following characteristics/functions:

  1. Has a function that asks the user for their first name and store it to a list.
  2. Has a function that selects a random number for each name and add it to a second list. a. The random number must be generated in its own function.
  3. From inside that function, get a random number between 1 and 10.
  4. Has a function that prints out both lists in the format: a. Name – Random number (ie: Peter – 5)
  5. Has a function to only print a single name/number. This function must receive the name and not ask for it inside the function.
  6. The program must be menu driven Submit the code screen captures of all of the functionality. Submit the .py file AND the screen captures. Di NOT zip or compress the files.

HINTS If (): Call “get and store name” function Elif: Call “get and store number” function (The get number function calls the “get random number” function) Elif: Call function to “print both lists” Elif: Ask for name to print Call function to “print a single name and number” Elif: Quit

Aucun commentaire:

Enregistrer un commentaire