Anodyne
Wednesday, October 09, 2013
 
US/CDN Pricing Program v.1 
by CJB

# Gets user input - CDN price & discount, US price & discount

can_prix = raw_input('Please enter the Canadian price: ')
can_disc = raw_input('Please enter the Canadian discount (If in doubt use 40%): ')
us_prix = raw_input('Please enter the US price: ')
us_disc = raw_input('Please enter the US discount (If in doubt use 40%): ')

# Converts user's strings to floats for calculating purposes, o/w error when math performed on text string

canadian_price = float(can_prix)
canadian_discount = float(can_disc)
us_price = float(us_prix)
us_discount = float(us_disc)

#performs price comparison & advises of results

adjusted_price = us_price * 1.2
if adjusted_price > canadian_price:
    print "Original CDN price is a better deal than adjusted US price"
    print "Charge", canadian_price * .7, "CDN for this title."

elif adjusted_price < canadian_price:
    print "Adjusted US price is a better deal than original Canadian price"
    print "Charge", adjusted_price * .7, "CDN for this title."

raw_input("Press [ENTER]  to continue")


<< Home

Powered by Blogger

.post-title { display: none!important; }