Question: Homework 3 - Vectors and Strings Function Name: vineCompilation Inputs: 1. (char) The first vine quote 2. (char) The second vine quote Outputs 1. (char)
Homework 3 - Vectors and Strings 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: It's Sunday afternoon and you're hanging out in your lounge, finishing off your Sprite Cranberry. Your Mom Friend (Jared, 19) waks 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 hat 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 alphabeical 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- This can empty. YEET vine2- fre sha voca do compilation-vineCompilation(vinel, vine2) inelpty. YEETIThis can em vine2 vsroohfedcaa 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
Get step-by-step solutions from verified subject matter experts
