Explore BrainMass
Share

Explore BrainMass

    Webpage - Pig Latin

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Technically speaking, the Pig Latin rules that we have established apply only to words, not phrases. However, your current piglatin.html page does nothing to prevent users from entering a string containing spaces. Thus, a user could enter "foo bar" in the text box and be told that the Pig Latin translation is "oo barfay".

    Modify your PigLatin function so that, before the string is translated, the function checks whether the input is a single word (i.e. whether it contains any spaces). If there are spaces in the input, the function should return the string "ILLEGAL INPUT".

    © BrainMass Inc. brainmass.com October 9, 2019, 9:48 pm ad1c9bdddf
    https://brainmass.com/computer-science/web-design/webpage-pig-latin-198222

    Attachments

    Solution Summary

    This solution involves writing a function that will translate words to Pig Latin.

    $2.19