QuestionQuestion

File #1 – Microsoft Word Document
You are expected to provide the following evidence of a DDIT approach
Requirement 1: IPO CHART 20%
Create an IPO chart for the main game loop using the techniques outlined in week 2’s IPO chart and Pseudocode example guide and your lab submissions. Do NOT explain any of the methods that are defined in the starter code, for your pseudocode you can use them as if they made perfect sense. For example, you might say “RUN rollDie with userNumber” if userNumber was input earlier. Anything reasonable will be accepted but you do not have to explain how the modules work, only refer to them when creating your IPO chart.

Requirement 2: FLOW CHART 20%
Create a flow chart for the module specified in the below table. Turning in a flow chart for the wrong module is an automatic 0 for this section.
If your student number ends with:                      Your flow chart is of module:
0,9                                                                        validateInt( min, max, prompt )
1,8                                                                        pattern1( sides, dice )
2,7                                                                        pattern2( sides, count, dice)
3,6                                                                        pattern3( dice )
4,5                                                                        pattern4( sides, dice)
For your flowcharts you may assume the input parameters are initialized, but be sure to state any assumptions about these values.

Requirement 3: TESTING 10%
Demonstrate complete coverage traces of your flow chart. Pick your values deliberately to ensure that every path in your flow chart is followed and produces the correct answer.

File #2 – Python program source code 50%
Implement the program described here in Python. Use the provided starter code as a basis for your work. You are required to use elements from all aspects of the course.
You will be evaluated for
Use of appropriate syntactic structures (sequential, selection, repetition, modules, lists)
Appropriate choice of data types (at least 3 of the 4 data types are required)
Variable names, comments, etc (general readability)
Correctness – does the program work?

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

import random
import math

student_numer =
student_name =

def rollDie(faces):
    # module to roll a single die with a variable number of faces
    # ASSUME faces is a valid positive integer, greater than 1
    return random.randint(1, faces)


def validateInt(min, max, prompt):
    # ASSUME min and max are valid positive integers, and that min < max
    number = min - 1
    while number < min or number > max:
       value = input(prompt)
       if value.isdecimal():
            number = int(value)
            if number > 0:
                if number < min or number > max:
                   print('I\'m sorry, that isn\'t in the range {0} to {1}, please try again'.format(min, max))
                   pass
                pass
            else:
                print('I\'m sorry, that isn\'t a valid positive integer, please try again')
                pass
            pass
       else:
            print('I\'m sorry, that isn\'t a valid positive integer, please try again')
            pass
       pass
    return number


def validateStr(prompt, listOfChoices):
    # assume prompt is a String and listOfChoices is a list of Strings.
    unmatched = True
    a_string = ' '
    while unmatched:
       a_string = input('{0} {1} '.format(prompt, listOfChoices))
       a_string = a_string.lower()
       for item in listOfChoices:
            if item == a_string:
                unmatched = False
                pass
            pass
       if unmatched:
            print('I\'m sorry, the choices are {0} . Please pick one of them.'.format(listOfChoices))
            pass
       pass
    return a_string


def average(inList):
    # ASSUME inList is a list of numbers and the length of inList is > 0
    total = sum(inList)
    avg = total / float(len(inList))
    return round(avg, 0)


def calculatePercentage(sides, dice, diceRolls):
    # ASSUME sides*dice != 0, sides, dice are numbers
    # ASSUME diceRolls is a list of numbers
    max_score = sides * dice
    percent = float(max_score)/ float(sum(diceRolls))
    return percent


def isPrime(number):
    # ASSUME number is an integer
    square = int(math.sqrt(number))
    n = 3
    while n <= square:
       if number % n == 0:
            return False
       n = n + 2
       pass
    return True


def pattern1(sides, dice):
    # ASSUME sides > 0 and dice is a list of integers
    # all dice have the same value # of sides >= 4
    if sides < 4:
       print('Pattern 1 not matched in your roll, {0} ... # of sides < 4.'.format(dice))
       return 0
    sample = dice[0]
    for item in dice:
       if item != sample...

By purchasing this solution you'll be able to access the following files:
Solution.docx and Final-Project-Starter-Code.py.

$48.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Python Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats