%-------------------------------------% % Homework 3: problem 3.3 % % Date: 9/30/02 % % % % Gun Srijuntongsiri % % gs61 % % ?????? % %-------------------------------------% weight=input('Enter weight (lbs) : '); % weight in pound, user input. cost = 0; % delivery cost in dollars, initialized to zero. % Check for overweight. If not, calculate the cost if weight > 100 disp('Overweight. Will not be processed.'); else cost = cost+10; % first two pounds charge. % If more than 2 lbs, $3.75 for additional lbs. if weight > 2 cost = cost+3.75*(weight-2); end % If more than 70 lbs, $10 excess weight surcharge is added. if weight > 70 cost = cost+10; end % Finally, display total cost. disp(['The cost of sending this package is $',num2str(cost)]); end