urgenteeee

profiledarlen11
hw44.docx

COSCHomework 4

Write your solutions on paper and hand in at the beginning of class on the due date.

2. Write a method minCat that takes two strings s and t, and returns a new string. The returned string contains the concatenation of s and t; however, if one of the strings is longer than the other, omit characters from the end of the longer string so that it is the same length as the shorter string.

minCat("Hello", "hi") returns "Hehi"

minCat("hi", "Hello") returns "hiHe"

minCat("cat", "dog") returns "catdog"

minCat("a", "Hello World") returns "aH"