This preview shows page 1. Sign up to view the full content.
Unformatted text preview: % to get the total salary total_salary = sum(money_earned); fprintf('\n') fprintf(' Total salary $%.2f paid out\n', total_salary) % elements of array C are added to get the total number of items total_items = sum(output); fprintf('\n') fprintf(' Total %.0f items made\n', total_items) % total salary is divided by total items average_cost = total_salary./total_items; fprintf('\n') fprintf(' Average cost $%.3f to produce one item\n', average_cost) % total hours are divided by total items total_hours = sum(hours_worked); average_for_item = (total_hours./total_items); fprintf('\n') fprintf(' %.3f hours to produce one item\n', average_for_item) % Calculating the efficiency defined as output divided by hours worked efficiency = output./hours_worked; fprintf('\n') fprintf(' Efficiency of each worker:\n') fprintf(' %.1f\n', efficiency) fprintf('\n')...
View Full Document
This note was uploaded on 04/21/2010 for the course ENGINEERIN 87897 taught by Professor Noclue during the Spring '07 term at UC Davis.
- Spring '07