Question: Problem 3 ( 1 0 points ) Remember waaaay back in homework 2 when you wrote an algorithm for sorting Dr . Harper's horde collection
Problem points
Remember waaaay back in homework when you wrote an algorithm for sorting Dr Harper's
horde collection of buttons? After almost an entire semester of learning MATLAB, she knows
you're ready to tackle writing the sorting code. You might want to start by revisiting and
potentially revising your algorithm.
The file HW buttons txt contains a list of buttons to sort. The information for each
button is formatted as a string of length with information on its number of holes, shape, and
color. The first character is the number of holes, the second is the shape, and the third is the
color. For example, a circular, blue button with holes is Below is a list of characteristics
and their corresponding character:
The last line of the file is a single # to indicate the end of the file.
Requirements:
Read the data in using fscanf
Your code must be able to accept a list of buttons of any length
Every button's information will be formatted the same way, we promise!
Your code should include at least one userdefined function more is OK
Send to the screen a text summary of the number of buttons with each of the
characteristics listed above so Dr can compare the amount of buttons in each category.
It is fine to refer to the categories by their singlecharacter designations.
The code should prompt a user to enter the character string associated with a particular
kind of button egcb and tell the user how many of that button there are in the
collection.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
