Home / Expert Answers / Computer Science / i-need-clarification-on-how-to-identify-and-convert-the-below-python-code-to-flowchart-on-raptor-u-pa316

(Solved): I need clarification on how to identify and convert the below python code to flowchart on Raptor. U ...



I need clarification on how to identify and convert the below python code to flowchart on Raptor.

Understanding if declaring constants are assignments box

and variables are the call box with the arrows

While loop is sRaptor
File Edit Scale View Run Mode Ink Window Generate Helpelection; however what flowchart symbol would you use for Else, If, etc.

-Thank you!

# Declaring constants and variables
MAX_NUM = 4
MIN_NUM = 0
rating = 0 # holds user rating input
accumRating = 0 # holds the ratings total
ratingsCount = 0 # number of valid ratings entered
ratingAvg = 0 # average rating

# Get the amount of awarded stars
def getRating():
global rating
rating = int(input("Enter a star rating between 0 and 4 or -1 to quit: "))


# Calculate the total number of ratings
def calculateTotal():
global accumRating, ratingsCount
accumRating += rating
ratingsCount += 1

# Get the amount of awarded stars
getRating()

# Accumulate ratings until -1 is entered
while rating >= MIN_NUM:
if rating > MAX_NUM:
print("Invalid input - Please enter a star rating between 0 and 4 or -1 to quit")
else:
# Calculate the total number of ratings
calculateTotal()

# Get the amount of awarded stars
getRating()

if ratingsCount >= MIN_NUM:
# Calculate the average rating
ratingAvg = accumRating / ratingsCount

Raptor File Edit Scale View Run Mode Ink Window Generate Help


We have an Answer from Expert

View Expert Answer

Expert Answer



Here's a possible way to convert the Python code to a flowchart on Raptor:


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe