Question: Function Name: bossFinder Inputs: 1. ( char ) A MxN character array of names Outputs: 1. ( char ) The name of the boss Topics:
Function Name: bossFinder
Inputs:
1. ( char ) A MxN character array of names
Outputs:
1. ( char ) The name of the boss
Topics: ( arrays ), ( indexing )
Background:
It's time...You have been working like crazy and feel confident that you deserve a
promotion. The one issue is that your company never actually told you who the boss is.
However, luckily the CEO Blake is a huge MATLAB fan so he always would choose bosses by
who had the best name in terms of the ascii value. You now know what you must do, and you
pull up MATLAB to go get that promotion.
Function Description:
Given a character array of names of all the higher ups in the company, you must find
who the boss is. The CEO determines the best name based on which names have the highest
sum of their corresponding ascii values. You must calculate this value for the names and then
index out the name of your boss.
Example:
array = ['emma';
'john';
'jack';
'jane';
'fred']
boss = bossFinder(array)
boss = 'john'
Notes:
The name must be outputted exactly how it appears in the array
Each of the names within the array will always be the same length.
Notes:
The second input of the sum() function may help here
Banned functions: Conditional Statements(if,else,elseif) and Iterations(loops)
Please solve using matlab and array techniques. To receive a thumbs up please do not use any conditional statements(if,else,elseif) or iterations(loops) on this problem!!!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
