Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

for matlab Function Name: vineCompilation Inputs: (char) The first vine quote (char) The second vine quote Outputs: 1. (char) A compilation of the vines Background:

for matlab

Function Name: vineCompilation

Inputs:

  1. (char) The first vine quote

  2. (char) The second vine quote

Outputs:

1. (char) A compilation of the vines

Background:

Its Sunday afternoon and youre hanging out in your lounge, finishing off your Sprite Cranberry. Your Mom FriendTM (Jared, 19) walks in and yells at you for drinking soda for breakfast. Aggravated, you YEET the empty can down the hall as Jared drags you to the kitchen to make breakfast. You open the fridge to find some tortillas, eggs, and wow! Look at all that chicken! Jared says he could make the perfect breakfast tacos if he only had some fre sha voca do. You guys get your fre sha voca dos and Jared makes you some scrumptious breakfast tacos. To repay him, you make him a compilation of his favorite vines, with a little help from your friend MATLAB!

Function Description:

Given two string inputs, swap the first and second halves of the first input and sort the second input in reverse alphabetical order. Then, compile the two strings by inserting the first string into the odd indices of the output, and the second string into the even indices of the output. If one string is longer than the other, add exclamation points to the end of the shorter string so the strings are the same length.

Example:

vine1= ' ' vine2= ' ' compilation = vineCompilation(vine1, vine2) vine1 ' ' vine2 ' ' compilation 'pvtsyr.o oYhEfEeTd!cTahai s c!a !n! !e!m !'

Notes:

  • If the first string's length is an odd number, split it into two unequal halves with the first half being longer than the second, then swap them.

    Hints:

  • The sort() function can take in two parameters.

  • The ceil() 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

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

Domain Transfer Learning With 3q Data Processing

Authors: Ahmed Atif Hussain

1st Edition

B0CQS1NSHF, 979-8869061805

More Books

Students also viewed these Databases questions

Question

What is meant by 'Wealth Maximization ' ?

Answered: 1 week ago