This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: total_items = sum(output) fprintf('Total Items Made: %.0f\n', total_items) disp(' ') %newline % d) Display the average cost to produce one item %This is found by dividing the total salary paid out by the total number of items fprintf('The average cost to produce one item is $%.3f\n', total_salary/total_items) disp(' ') %newline % e) Display the number of hours it takes to produce one item on average %This is found by dividing the total hours worked by the number of items made total_hours = sum(hours) fprintf('The average time to produce one item is %.3f hours\n', total_hours/total_items) disp(' ') %newline % f) Calculate and display the efficiency of each worker %This is defined as output divided by hours worked efficiency = output ./ hours %Convert to matrix array with worker number and week's wage for each num_efficiency = [worker efficiency] Sheet1 Page 2 fprintf('Efficiency for worker %.0f: %.1f items/hour\n', num_efficiency)...
View Full Document
This note was uploaded on 01/22/2011 for the course ENG 006 taught by Professor Lagerstrom during the Spring '06 term at UC Davis.
- Spring '06