Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ces Mailings Review View Normal No spacing ABM Pig Latin is a language game in w

ID: 3780301 • Letter: C

Question

ces Mailings Review View Normal No spacing ABM Pig Latin is a language game in which words in English are altered. The objective is to conceal the words from others not familiar with the rules. The reference to Latin is a deliberate misnomer, as it is simply a form ofjargon, used only for its English connotations as a strange and foreign-sounding language. To translate a word into Pig Latin, move all letters up to, but not including the first vowel (a,ci.ou), to the end of the word and append the -ay suffix. Pig igpay Latina atinlay School golschay. In inay out gutay Yes Sway. STOP and THINK BEFORE YOU CODE. write a function that translates a string ofEnglish words to a string of Pig Latin words. engineers rule the world Include: Help comments for the function, including o The name of the function o A description examples of the function's usage o The ENGR 111/112 MATLAB script standard header Appropriately-named variables o CONSTANTS IN ALL CAPITALS o variableslocamelcase Headin

Explanation / Answer

function pigLatinString = pig_latin(str)
send = '';
for i=1:1:size(str,2)
    if str(i)=='a' || str(i)=='e' || str(i)=='i' || str(i)=='o' || str(i)=='u'
        sbeg = str(1,i);
        break
    end
    send = send + str(i);
end
s = sbeg + send;
%disp(s);
s = strcat([cellstr(s), 'ay']);
pigLatinString = s;