Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

input (“(B)udget, (D)aily, or (W)eekly rental

i get an error with my script and am not sure why since i have averageWeeklyMiles = totalMiles/rentalPeriod ? it says nameError: name ‘averageDayMiles’ is not defined codio@sister-janet:~/workspace$ Here is my script in Python

import sys

#ask user for input of type of rental

Need assignment help for this question?

If you need assistance with writing your essay, we are ready to help you!

OUR PROCESS

Order

Payment

Writing

Delivery

Why Choose Us: Cost-efficiency, Plagiarism free, Money Back Guarantee, On-time Delivery, Total Сonfidentiality, 24/7 Support, 100% originality

rentalCode = input (“(B)udget, (D)aily, or (W)eekly rental?”)

if rentalCode == “B” or rentalCode == “D”:

  rentalPeriod = int(input(“Number of Days Rented: “))

else:

   rentalPeriod = int(input(“Number of Weeks Rented: “)) 

budgetCharge = 40.00

dailyCharge = 60.00

weeklyCharge = 190.00   

if rentalCode == “B”:

 #calulate charges depending on input from above

 baseCharge= rentalPeriod * 40.00

elif rentalCode == “D”:

  baseCharge= rentalPeriod * 60.00

else:

   baseCharge= rentalPeriod * 190.00

odoStart = (input (“Starting Odometer Reading:”))

#b)   Prompt the user to input the ending odometer reading and store it as the variable odoEnd

odoEnd = int(input(“Ending Odometer Reading:”))

#ask user for milage input

print (“(B)udget, (D)aily, or (W)eekly rental?”)

print (“Number of Days Rented”)

print (“Starting Odometer Reading:”)

print (“Ending Odometer Reading:”)

#calulate miles driven

totalMiles = int(odoEnd) – int(odoStart)

#calulating of charges based on miles driven and rental type

if rentalCode == “B” :

     mileCharge = totalMiles*0.25*rentalPeriod

elif rentalCode == “D”:

   averageDayMiles = totalMiles/rentalPeriod

if averageDayMiles <=100 :

  extraMiles = 0

else:

  extraMiles = float(averageDayMiles – 100)

  mileCharge = float(extraMiles*0.25*rentalPeriod)

  averageWeeklyMiles = totalMiles/rentalPeriod

if averageWeeklyMiles <=900:

  extraMiles = 0

else:

 extraMiles = float(totalMiles – 900)

 mileCharge = float(extraMiles*100*rentalPeriod)

amtDue = baseCharge + mileCharge

print (“Rental Summary”)

print(“Rental Code:”+ (”  “) +(rentalCode))

print(“RentalPeriod:” + (”  “) +str(rentalPeriod))

print(“Starting Odometer:” + (”  “) +str(odoStart))

print(“Ending Odometer” + (”  “) + str(odoEnd))

print(“Miles Driven:” + (”  “) +str(totalMiles))

print(“Amount Due:” + (”  $”) +str(amtDue))

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"