CIS 325 – Programming for Business Data Analytics

CRITERIA FOR SUCCESS

 

1. The lectures and in-class exercises posted in our course site, are annotated examples of effective Python script submissions. Students should take the time to study these in-class exercises to see examples of successful Python scripts in practice for this assignment.

2. A successful assignment submission has Python code that is ready to run in Anaconda Spyder by hitting the Run function button (or pressing F5 in Windows). Be advised that the Instructor will not be debugging nor modifying your code to run correctly for review and/or grading purposes.

3. I would encourage students to follow, in your Python script submissions, the Python Style Guidelines, as

outlined in the ‘Zen of Python’ style guide. Following these guidelines in your submissions will be an essential consideration in your grades for this assignment.

4. I recommend students to be proactive and not wait until the last minute to do this assignment. I can guarantee that you may run into technical issues if you fail to be proactive. This is a great opportunity to practice your professional skills, having contingency plans to manage technical issues. It may take 24 hours for the instructor to respond to your emails, so plan accordingly and be proactive when requiring assistance from the instructor given the deadline for this assignment.

 

SCENARIO OVERVIEW

 

Your customer, one of the largest casinos in Las Vegas, is asking you to create a simulation of customers playing Dice. This simulation will be used as part of a larger system, to identity the profitability of dice gambling stations in your customer. There are rules governed by the Nevada gambling commission that ensure all dice have fair weights, having 6 faces, with each face being numbered starting with 1 and going through and including 6.

On your kickoff meeting with your customer, you are asked to write a simple Python simulation with the following requirements being discussed:

    1) Ability to select the number of dice in simulation

    2) Confirm number of dice in simulation

    3) Roll the selected number of dice and store results in a list

    4) Print to the Python console your list of results for further analysis

    5) Help menu with commands to drive the simulation

    6) Quit the simulation

 

The following Python console screen is drafted in your requirements analysis meeting:

 

 

During your kickoff meeting, you wrote some notes as follows:

1) Option 1 - The model user selects the number of die to use in the simulation, from 2 and including 5 dice. This can be entered in Python using the command Dice X, where X is an integer from 2 to 5.

 

2) Option 2 – User can confirm the ongoing number of dice in the simulation. This will print a console message with the number of dice being used. This can be entered in Python using the command Confirm.

 

3) Option 3 - Using the console menu (using command line arguments and shlex input?), entering the command Roll in the console, followed by an integer number of simulations, would roll the selected dice (in Option 1), generating a simulated number of dice numbers in a Python list. Thus, the following actions will take place:

    a. The simulation will enter the simulation run index, which is an integer number that starts in zero, and increases by one, for every rolled simulation.

    b. The model randomly selects the numbers rolled for each die

    c. Results will be stored in a Python list for each die selected (see Option 1).

 

4) Option 4 – Entering the report command in the console will print the list of results, which seems straight forward. Thus, for each time a simulation runs (see Option 3), the following information gets stored in a Python list, so it could be printed by Option 4, as follows:

    a. Simulation Index – starting with the number zero and increasing for every additional roll

    b. Sum of rolled numbers – this can be generated while outputting content to the console for each die.

    c. Rolled Numbers – a list inside the list item with the rolled numbers depending on the number of die selected (see Option 1)

 

5) Option 5 – Entering the help command in the console will print the list of simulation commands to the console for assistance to the user

 

6) Option 6 – Entering the exit or quit command will exit the simulation. I assume at this point that the list may be used further for data analysis by their data science teams with my customer.

 

After the kickoff meeting, you reflect on your new assignment, and identify the following next steps:

1) The customer was clear about using at this stage Python functions as much as possible. The idea here is that they want to test my simulation first, if it works for them, they may have a second stage of this consulting engagement to use Python classes.

2) Your customer has offered to provide a starter enterprise template, named Console Application Template, used for console applications, with basic functionality to enter commands in a console app. This template must be used in your simulation per your customer requirements.

3) The storage of simulation runs requires a list. Thus, you will need to have a list with a list inside as an item. For instance, mylist = [ [0, [2, 4, 5]], [1, [3, 6, 5, 2]] ]

Need a custom answer at your budget?

This assignment has been answered 4 times in private sessions.

© 2024 Codify Tutor. All rights reserved