[SOLVED] Pig latin

30.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (1 vote)

Write a function that takes in an english sentence. This function should first calculate how many “words” are in the sentence (words being substrings separated by whitespace). It  should then allocate an array of the structure Word of this size (so large enough to hold the sentence). It should then store each of the words in that sentence to the array of structures in the english field. The function should then return this array to the calling function with a return
statement, along with a size through a reference parameter.
note: The allocation of this array should be done in the function itself, not in mainconverts the english field of the array to the piglatin field of the array and then displa the pig latin sentence the piglatin conversion of the word involves moving the first letter of the word to the end of the string and then adding “ay” to the
end.
pig – igpay
cat – atcay
dog – ogday
If the word starts with a vowel, simply add “way” to the end of the word
apple – appleway
are – areway

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.