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

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

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);
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

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern