cw2sort - num12 = num12 1%fprintf'Place in Cup Four Number...

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

View Full Document Right Arrow Icon
num6 = 0; num8 = 0; num10 = 0; num12 = 0; odds = 0; check = 0; c fprintf('Input screw size. To exit type "end"\n'); f while (check==0); w ScrewNumber = input(); S if (ScrewNumber == 'end'); check=1; %fprintf('You are done entering screws'); elseif (ScrewNumber == 6); num6 = num6+1; %fprintf('Place in Cup One, Number of Screws in Cup One %0.0f \n', num6); elseif (ScrewNumber == 8); num8 = num8+1; %fprintf('Place in Cup Two, Number of Screws in Cup Two %0.0f \n', num8); elseif (ScrewNumber ==10); num10 = num10+1; %fprintf('Place in Cup Three, Number of Screws in Cup Three %0.0f \n', num10); elseif (ScrewNumber ==12);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: num12 = num12+1; %fprintf('Place in Cup Four, Number of Screws in Cup Four %0.0f \n', num12); else (ScrewNumber); odds=odds+1; %fprintf('Place in Odds Cup, Number of Screws in Odds Cup %0.0f \n', odds); end end e fprintf('Machine Screw Sorting and Counting Algorith\n'); fprintf(' #6 #8 #10 #12 Odd \n'); fprintf(' %0.0f %0.0f %0.0f %0.0f %0.0f \n', num6, num8, num10, num12, odds); fprintf('The number of machine screws correctly sorted is %0.0f', (num6+num8+num10+num12)); fprintf('The total number of machine screws sorted is %0.0f', (num6+num8+num10+num12+odds));...
View Full Document

This note was uploaded on 09/19/2011 for the course ENGE 1114 taught by Professor Twknott during the Fall '06 term at Virginia Tech.

Ask a homework question - tutors are online