Question: Function Name: starbucks Inputs 1. 2. (double) An Nx6 array representing the menu (double) A 1x6 array representing the secret menu item Outputs: 1. (double)

Function Name: starbucks Inputs 1. 2. (double) An Nx6 array representing the menu (double) A 1x6 array representing the secret menu item Outputs: 1. (double) An Nx2 array representing the updated "grande" portion of the menu Background: On Monday at 2:45 PM sharp, you go to the CULC Starbucks to beat the lines and grab a coffee. Unfortunately, the line has filled the entire second floor, snaking around the stairs and all the way to the CS 1371 help desk in room 272. You quickly pull up a menu of the prices and calorie counts of all the drink options and decide to whip up a frothy MATLAB function to help you decide what to get from Starbs! Function Description: Each pair of columns in the input array represents a drink size: tall, grande, or venti respectively. The first column of the pair will contain a price for the drink, and the second will contain the calories in that drink. Each row represents a different drink. You'll make the following changes to the menu . Make the menu more healthy by removing the entire row of the drink with the highest number of calories in the venti size Append the price and calorie statistics for your favorite secret menu item, (the unicom frappuccino!), which is the second input, to the bottom of the menu Narrow down your options to only the two columns for grande price and calories Calculate a ratio of price per calorie and sort the rows of the grande menu based on this, . so that the ratio is increasing as you go down the columns Example: (Tall) (Grande) (Venti) 2.85 150 3.45 190 3.95 250 3.25 190 3.95 240 4.25 310 >>menu 1.95 60 2.45 80 2.95 120 ] >secret3.75 350 4.45 420 4.95 540 ] > newMenustarbucks(menu, secret) newMenu> 4.45 420 3.45 190 2.45 80 ] Notes: Overpriced and caffeinated beverages are not encouraged as a way to gain nutritional value
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
