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 selection; 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