comCost - j=j+m; end fee=0.15*j+60; elseif plan==3

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function fee = comCost(in1,phonerecord) plan = phonerecord(in1).plan; if plan == 1 j=0; for i=1:length(phonerecord(in1).call); m=phonerecord(in1).call(i).duration; j=j+m; end fee=0.25*j; elseif plan==2 j=0; for i=2:length(phonerecord(in1).call); m=phonerecord(in1).call(i).duration;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: j=j+m; end fee=0.15*j+60; elseif plan==3 j=phonerecord(in1).call(1).duration; for i=2:length(phonerecord(in1).call); m=phonerecord(in1).call(i).duration; j=j+m; if j<=180 k=0.3*j; else fee=.3*180+0.22*(j-180); end end end...
View Full Document

This note was uploaded on 11/16/2009 for the course ENGIN 7 taught by Professor Horowitz during the Spring '08 term at University of California, Berkeley.

Ask a homework question - tutors are online