#!/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_calc4.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 '----------------------------------------------------------' banner() ######### first one ################## 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)) ######### second one ################## 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)) ######### third one ################## 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() raw_input('\nHit to exit.')