Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use MATLAB to solve, no hard coding Function Name: goGetAC00kie Inputs: 1. ( char ) A vector of chars containing words separated by spaces Outputs:

Use MATLAB to solve, no hard coding

Function Name: goGetAC00kie Inputs: 1. ( char ) A vector of chars containing words separated by spaces Outputs: 1. ( double ) Length of the longest word 2. ( double ) Length of the shortest word 3. ( double ) Average length of all the words, rounded to 2 decimal places 4. ( double ) Mode length of all the words

Banned Functions: max, min, mean, mode, sort, maxk, mink

Topics: ( iteration ), ( string tokenization)

Background: Dang n00b, tough day. You just t00k a test and boy was it a d00zy. Now, you feel so f00lish because you realized s00n after that you g00fed and misunderst00d the long coding question like your parent or guardian misunderst00d your middle sch00l phase . To reb00t your m00d, you open your h00tenanny with a c00l background of a timberd00dle and navigate to Yah00! to l00kup a c00kie tyc00n near you. You are going to go get a c00kie, but what flavor to ch00se?

Function Description: Given the input vector of chars, determine the length of the longest c00kie name (output 1), the length of the shortest c00kie name (output 2), the average c00kie name length rounded to 2 decimal places (output 3), and the mode c00kie name length (output 4). Assign each of these values to their respective output, and b00yah! You have c00kies out the waz00. Clear eyes. Full heart. Big Brain. Can't Lose.

Example: c00kies = 'snickerd00dle raisin mint sugar oreo chocolate' [long, short, avg, mode] = goGetAC00kie(c00kies) long -> 13 short -> 4 avg -> 6.83 mode -> 4

Notes: All c00kie flavors will be one word. The longest possible c00kie flavor is 15 characters. A single space will separate each word, with no trailing spaces. Homework 07 - Iteration Mode cookie length refers to the most common length of cookie name, not how often that length occurs. No special characters or punctuation will be present. There is guaranteed to be one mode c00kie flavor length.

Hints: Don't forget to round the average c00kie name length to 2 decimal places. Make sure your function name matches the description (goGetAC 00 kie with double zeros instead of o's). The zeros function may be useful!

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_2

Step: 3

blur-text-image_3

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

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

More Books

Students also viewed these Databases questions

Question

Define the transition elements.

Answered: 1 week ago

Question

Find dy/dx if x = te, y = 2t2 +1

Answered: 1 week ago