optimPlan - cost = plan1; elseif...

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

View Full Document Right Arrow Icon
for j = 1:6 k=ttl_min(j,phonerecord); plan1=k*.25; plan2=k*.15+60; %to calculate plan3, we need: ttl_hrs=k/60; else_hrs=ttl_hrs-3; else_min=else_hrs*60; f3_hrs=ttl_hrs-else_hrs; f3_min=f3_hrs*60; plan3=f3_min*.3+else_min*.22; newplan = 1;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cost = plan1; elseif plan2<plan1&plan3 && plan2<plan3&plan1 newplan = 2; cost = plan2; elseif plan3<plan1&plan2 && plan3<plan2&plan1 newplan = 3; cost= plan3; end fprintf('Name: %s Plan: %.0f Bill: $%0.2f\n', phonerecord(j).name, newplan, cost) end...
View Full Document

Ask a homework question - tutors are online