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 3(10 points)
Remember waaaay back in homework 2 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 HW13 buttons . txt contains a list of buttons to sort. The information for each
button is formatted as a string of length 3 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 2 holes is 2cb. 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 user-defined function (more is OK.)
Send to the screen a text summary of the number of buttons with each of the 9
characteristics listed above so Dr.H can compare the amount of buttons in each category.
It is fine to refer to the categories by their single-character designations.
The code should prompt a user to enter the 3-character string associated with a particular
kind of button (e.g.,2cb) and tell the user how many of that button there are in the
collection.
Problem 3 ( 1 0 points ) Remember waaaay back in

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 Accounting Questions!