Question: Task 3 a . Read through following subtasks and create a flow chart of how the algorithm should look. b . Create an array named

Task 3
a. Read through following subtasks and create a flow chart of how the algorithm should look.
b. Create an array named quality made up of 12 elements between 1 and 4 using the command
randi([1,4],1,12)
The items 1 through 4 classify the quality of unspecified components:
1= Defective
2= Rework Needed
3= Pass
4= High Quality
c. Count the total number of items in the quality array by using the length function and store the
value in a variable named num_items
d. Create a variable named rework_count and initialize it to 0. This will be used to count how many
items need rework.
e. Use a for loop to iterate through each element of the quality array to check how many items need
rework. If so, increase the rework_count by 1.
f. Calculate the percentage of items that need rework and store this value in a variable named
rework_percentage.
g. Use the disp function to output the total number of items needing rework using num2str.
h. Type the variable name quality in the command window and count the amount of 2's in the array
to confirm your code worked.
Task 3 a . Read through following subtasks and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!