ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 4 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 05 May 2017 My Price 9.00

Homework #3: Strings & Conditionals

Homework #3: Strings & Conditionals

Function Name: gradeSorter

Inputs:

  1. (double) A vector of student grades.
  2. (char) A string of first initials corresponding to the grades.
  3. (char) A string of last initials corresponding to the grades.

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:

  •   The sort() function will take care of sorting equivalent grades.
  •   You will not have a tie in the grades.
  •   The ascii value of a space is 32. Any other values that appear as a space will be marked as incorrect and result in zero credit. Hints:
  •   The second output of sort() will be useful.

Answers

(11)
Status NEW Posted 05 May 2017 01:05 AM My Price 9.00

-----------

Not Rated(0)