Question: How would one create a flowchart in flowgorithm with the following code? ( Code is in Python ) import random def toFixed ( value ,
How would one create a flowchart in flowgorithm with the following code? Code is in Python
import random
def toFixedvalue digits:
return fdigits value
random.seed # Prepare random number generator
# Function to get valid scores
def getscoreprompt:
while True:
printprompt
score floatinput
if score :
return score
# Get three scores from the user
Grade getscoreThe first grade could be from to
Grade getscoreThe second grade could be from to
Grade getscoreThe third grade could be from to
sum Grade Grade Grade
PossibleGrades
grades ABCD
gradelimits
probability
# Determine the minimum scores needed for each grade
if sum :
PossibleGrades sum
if sum :
PossibleGrades sum
if sum and sum and sum :
PossibleGrades sum
if sum and sum and sum :
PossibleGrades sum
# Calculate probabilities for each grade
for in range:
x intrandomrandom
for Index in range:
if x PossibleGradesIndex:
probabilityIndex
# Print combined statements
for Index in range:
if PossibleGradesIndex:
prob toFixedprobabilityIndex
minscore PossibleGradesIndex
grade gradesIndex
printfYou have a prob of probability to obtain grade with a minimum score of minscore
if sum :
printIt is not possible to pass the course."
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
