% bills.m % % BILLS (ALIANT,NBPOWER) % % This function determines how much Brendan and Charlie should each pay per % month, assuming that Rosy and Kaley each chip in $20. % Copyright 06-07-2006 Brendan C. Wood -- Synchroverge function bills(aliant, nbpower) contribution = 20; total = aliant + nbpower; cut = total - 2 * ( contribution ); each = cut / 2; fprintf('\n\nAliant\t\t-->\t$%.2f\nNB Power\t-->\t$%.2f',aliant,nbpower); fprintf('\n\nBrendan\t\t-->\t$%.2f\nCharlie\t\t-->\t$%.2f\nKaley\t\t-->\t$%.2f\nRosy\t\t-->\t$%.2f',each,each,contribution,contribution); fprintf('\n\nTotal\t\t--> $%.2f\n\n',total);