Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You have a big problem. In one of your CS courses, your professor decides that the only way you will pass the class is if

You have a big problem. In one of your CS courses, your professor decides that the only way you will pass the class is if you write a MATLAB function to get him out of a mess. All the grades in his class have been accidentally stored into one long string of characters containing only the letters A, B, C, D, F, and Y. a. Your job is to write a function called Crazy Grade that will take in the string and flip the grades according to the following specifications: A becomes F - B becomes D - C remains unchanged D becomes B - F becomes A - Y becomes W Your function should take in a string and return an inverted string. You may assume that the string will only consist of valid letter grades. For example, Crazy Grade ('BADDAD') should return 'DFBBFB' Crazy Grade ('BAYBAY') should return 'DFWDFW' b. To make matters worse, he wants you to organize this modified grade set. Write a function called GradeDist to bunch together all the similar grades (put all the AS next to each other, B'S next to each other , etc.) Then calculate and return the professors grade distribution. Your function should take in a string and return a string with all similar grades grouped together, along with an array containing percentage values from AS all the way to F'S. For example, if there are 15% A'S, 16% B'S, 33% C'S, 16% D'S, 16 F'S and 4% W'S, GradeDist should return [15 16 33 16 16 4]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1 7 1 8 * 9 =

Answered: 1 week ago

Question

What is its position?

Answered: 1 week ago