#!/usr/bin/env python # # Author : Ahmed Obied (amaobied@ucalgary.ca) # Port to Python 3.x by James Tam (Version Sept. 2023) # Date : Jan. 17th 2008 # Purpose : Determines the amount of tax charged (based on a 7% rate) # and the total dollar value to be paid by a customer for # a given retail value. Also it determines the amount of # change that is owed to the customer. # # constant for the GST GST = 1.07 # the amount of the item that is purchased by the customer retail_price = float(input("Enter the amont of the item that is purchased in CND $")) # calculate the amount purchased with the GST total = GST * retail_price # print the total amount the user owes us including GST print("The total amount the customer owes us is $%.2f" %total) # enter the amount the customer pays amount_paid = float(input("Enter the amount the customer has paid in CND $")) # calculate the owed amount change = amount_paid - total # print it to the console with proper formatting print("Change owed to the customer $%.2f" %change)