Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

I am having difficulties figuring out how to add a loop. I need to add a would you like to continue: y/n?

I am having difficulties figuring out how to add a loop. I need to add a would you like to continue: y/n? With yes looping the program and n ending with a bye message.

#!/usr/bin/env python3

# display a title

("Program: Shipping Calculator"

"nProgrammer: Jacob Jones"

"nDate: 03/25/2019"

"nPurpose: This program is designed to determine the total cost of your purchase including shipping.")

# Welcome message

print("=======================================================================")

print("Shipping Calculator")

print("=======================================================================")

# get input from the user

cost = float(input("Enter cost of items:  "))

while cost < 0:

   print("You must enter a positve number. Please try again.")

   cost = float(input("Enter cost of items:   "))

if cost >= 75:

   shippingCost = 0

elif cost >= 50:

   shippingCost = 9.95

elif cost >= 30:

   shippingCost = 7.95

elif cost >= 0:

   shippingCost = 5.95

#Calculations

message = ("Bye!")

# Display the result

print()

print("Shipping Cost: " , shippingCost)

print()

print("Total Cost: ", shippingCost + cost)

print()

print(message)

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question