Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Draw a flow graph and calculate the cyclomatic complexity for the algorithm/program created : # define variables name = age = 0 hours_worked =
Draw a flow graph and calculate the cyclomatic complexity for the algorithm/program
created :
# define variables
name = ""
age = 0
hours_worked = 0
earnings = 0.0
# list of performers
performers = []
# input data
name = input("Enter name: ")
age = int(input("Enter age: "))
hours_worked = int(input("Enter number of hours worked: "))
earnings = float(input("Enter earnings: "))
# processing data
if hours_worked >= 7 and earnings >= 10:
performers.append({"name": name, "age": age, "status": "Best Performer Award"})
elif hours_worked < 14:
performers.append({"name": name, "age": age, "status": "Second Place"})
else:
performers.append({"name": name, "age": age, "status": "Notice to improve"})
# output data
for performer in performers:
print(f"Name: {performer['name']}")
print(f"Age: {performer['age']}")
print(f"Status: {performer['status']}")
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