Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

def main(): name = input(Please enter the name of the customer:) age = int(input(Please enter the customer's age)) if age < 16 or age>105: print(Invalid)

def main(): name = input("Please enter the name of the customer:") age = int(input("Please enter the customer's age")) if age < 16 or age>105: print("Invalid") else: trafficviolations = int(input("Please Enter the number of traffic violations:")) rcode,rType = CalR(name,age,trafficviolations) price = Calprice(name,age,trafficviolations,rcode,rType) statement(name,rType,price)

def Calprice(name,age,trafficviolations,rCode,rType): if age< 25: if trafficviolations >=4: rcode=1 price= 480 elif trafficviolations >=3 and trafficviolations <4: rcode= 2 price= 450 elif trafficviolations>=2 and trafficviolations <3: rcode= 2 price= 405 elif trafficviolations>=1 and trafficviolations <2: rcode= 2 price= 380 elif trafficviolations <1: 4 325 age>=25: if trafficviolations >=4: rcode= 1 price=480 elif trafficviolations >=3 and trafficviolations <4: rcode= 2 price= 450 elif trafficviolations>=2 and TrafficViolations <3: rcode= 2 price= 405 elif trafficviolations>=1 and trafficviolations <2: rcode= 2 price= 380 elif trafficviolations <1: rcode= 4 price= 325

def CalR(name,age,trafficviolations): if trafficviolations >= 4: rcode= 1 rType= 'high' elif trafficviolations==3: rcode= 2 rType= 'moderate' elif trafficviolations==2: code= 2 rType= 'moderate' elif trafficviolations==1: rcode=3 rType= 'low' elif trafficviolations==0: rcode=4 rType= 'no'

def statement(name,rType,price): print(price)

print(rType)

main() Can someone explain to me why i'm getting an unpacked error when i type print(price), and if you can please answer why it will print the rcode when I type print(rType)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions