Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are a shipping manager for the Ostrich Express courier service. For the last 20 years of your life, you've hand calculated the supply of

You are a shipping manager for the Ostrich Express courier service. For the last 20 years of your life, you\\\\\\\'ve hand calculated the supply of ostriches you have available in each country. This required process takes an abundance of time: every single time a change occurs with available ostriches you have to perform calculations and resubmit the supply to your superiors. Finally, after almost a decade of failed HR requests, Ostrich Express has teamed up with Mathworks and has given you commercial access to MATLAB. Now, you are devoted to automating the shipping calculation process for the sake of the company!

ostrichExpress

  1. 1. (string ) A 1x4*N vector of all the ostrich’s locations
  2. 2. (string ) A 1x3 vector of the customer’s current location

Outputs:

  1. 1. (double ) A 1x1 number of available couriers
  2. 2. (string ) A 1x4*M vector of unavailable couriers

Function Description:

Given a string containing multiple 3-letter country codes with a trailing space and a string indicating the country code that corresponds to the customer’s location, determine how many available couriers there are and then list the unavailable couriers’ locations in their original order.

Example:

birds = \\\\\\\'DJI GHA MOZ DJI NER NER NER GHA\'

[available, unavailable] = ostritchExpress(birds,\\\\\\\'DJI\\\\\\\'); available → 2

unavailable → \\\\\\\'GHA MOZ NER NER NER GHA \\\\\\\'

Notes:

  • ● All country codes are guaranteed to be three letters and separated by a single space (with a single space following the last country code).
  • ● There will always be at least one unavailable courier
  • ● The output string should follow the same formatting as the input string with respect to trailing spaces

Please answer questions fully without using conditional statements and iterations such as If, then, for, else for full credit. Solve problems using masking techniques!

Step by Step Solution

3.52 Rating (166 Votes )

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

Understanding Basic Statistics

Authors: Charles Henry Brase, Corrinne Pellillo Brase

6th Edition

978-1133525097, 1133525091, 1111827028, 978-1133110316, 1133110312, 978-1111827021

More Books

Students also viewed these Programming questions