The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 4 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Homework #3: Strings & Conditionals
Function Name: gradeSorter
Inputs:
Outputs:
1. (char) A string of first and last initials sorted by corresponding grade.
Function Description:
You try to get on your professor’s good side by mentioning your awesome MATLAB skills. Unfortunately, it backfires because he then ignores FERPA and asks you to write code to sort the first and last initials of the students in the class according to their grades.
Your professor gives you a vector of the student grades, a string of first initials corresponding to the grades, and a string of last initials corresponding to the grades. Given these inputs, write a function that outputs a string with the combined first and last initials of every student, with spaces in between, that is sorted by the students’ grades in descending order. To clarify, an output string might look like this: ‘RC RW JM LT BS’, where the student RC had the highest grade, and the student BS had the lowest. Notice that there are spaces in between the initials of each student but not after the last student, and note that there is no punctuation in the string.
Notes: