Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use Matlab: Matlab Function Name: fruitMarket Inputs 1. 2. (char) List of three fruits you want to buy, capitalized, comma separated (with no spaces)

Please use Matlab:

image text in transcribed

Matlab

Function Name: fruitMarket Inputs 1. 2. (char) List of three fruits you want to buy, capitalized, comma separated (with no spaces) (char) Character array of capital letters representing fruit market stalls Outputs 1. (char) Minimum cost of buying all your fruit Background Modern day shoppers always struggle to find the cheapest prices in a market. With today's extensive buying options, shoppers like you need an optimal way to find the best deals Function Description Given a comma separated list of fruit that you want to buy, and a character array of the fruit that each stall sells in the market, calculate the minimum cost of buying all of the fruit on your list Each letter in the character array indicates which fruit the stall sells (based on the first letter of the fruit's name). The product (multiplication) of the character's coordinates determines the price of the fruit sold by that stall. The character array below is an example of the fruit sold at a fruit market. BKAO OGPL MTMB Banana is sold at two stalls: the stalls with coordinates [1,1] and [3,4]. Hence, you can buy bananas for $1 or $12 dollars each. You should output your final cost as a string, without any decimals: $costfruitMarket(list, market) cost = .$6. Notes . You may have repeat fruits in your list which means you are purchasing more than one of that fruit . If there are repeat fruits in the character array, find the minimum cost. Hints . You can get two outputs from find()

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

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions