Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started