Module 5 Assignment 1 features the design of pseudocode to support a Python program that requires coordination between the control structures and modules of two programs. This lab asks you to write pseudocode that plans the program’s logic before you write the program in Python in the next assignment. You will turn in only the pseudocode for the two modules for M5 Assignment 1.
Instructions
Write pseudocode for a Python program that makes 100 dice rolls with a single 6-sided die and displays the number of times each side appeared. Turn in the two modules for the pseudocode for the following instructions. The following steps describe what we want our two program modules to do.
Before proceding, download the files dice.py, dog.py, dog_new.py and M5Lab2dice_hist.py, as all will be referenced in your assignments this week. To find these files, reference the folder Module 5>Assignments>Exercises. These files were also in the zip file you downloaded in Module 1.
Requirements for Your M5 Assignment 1 Pseudocode for Program Integration
For the first module, write the pseudocode to process these tasks:
(Note: lines beginning with # are comments with tips for you)
From the random module import randint to roll each die randomly
# in pseudocode, import a random function
# the name is helpful for the next M5-2 assignment
Define a class called Dice
In Python, the syntax has a colon after it: class Dice():
In pseudocode, you can specify it generally or be specific
Under the class declaration, list the attributes. Here are some tips:
# attributes are what we know about a single die (dice is plural)
# self is the first attribute in Python and must always appear first
# add a num_sides attribute and to set it to 6 for the 6 sides on the dice