#!/usr/bin/env python # # program used to compute the total cost of user specified # number of items with a unit price of ITEM_COST # # written by e.bonakdarian feb 2010 # # cost_calc5.py # ITEM_COST = 15.00 # cost per item in dollars 'constant' def banner(): # display a company banner print '\n----------------------------------------------------------' print 'The most Spledifirous Cost Calculation program ever!' print print ' __o' print ' _`\<,_' print '(*)/ (*)' print '\nBig Bucks Productions Inc (c) 2010' print '----------------------------------------------------------' def calc_cost(): # computes total cost given item cost and number bought print '\nComputing total cost for items (priced $', ITEM_COST, ' per piece).' number = input('\nEnter number of items purchased: ') # compute total cost total_cost = number * ITEM_COST # print result print('At $%.2f per item, %d item(s) will cost $%.2f.' % (ITEM_COST, number, total_cost)) banner() calc_cost() calc_cost() calc_cost() banner() raw_input('\nHit to exit.')