Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Do a program that translates a word from English to Pig Latin. Get the word from the user. Pig Latin is a nonsense language. To


Do a program that translates a word from English to Pig Latin. Get the word from the user. Pig Latin is a nonsense language. To make a word in Pig Latin, you remove the first letter of the English word and then add the first letter and "ay" at the end. For example "dog" becomes "ogday" and "cat" becomes "atcay". Here are the steps:

  • Declare a string variable
  • Print instructions to the user
  • Use the ReadLine() function in 2-11 to input the word
  • Get the first character using the string index (for instance the string myWord would index as myword[0])
  • Get the rest of the string minus the first letter by calling the function myWord.Substring(1)
  • Put the new Pig Latin string together using string arithmatic (with a string 'restOfWord' and character 'firstLetter' make the program statment: restOfWord + first + "ay")
  • Print out the Pig Latin word

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Entrepreneurship

Authors: Andrew Zacharakis, William D Bygrave

5th Edition

1119563097, 9781119563099

More Books

Students also viewed these Algorithms questions

Question

Answered: 1 week ago

Answered: 1 week ago

Question

Describe ERP and how it can create efficiency within a business

Answered: 1 week ago

Question

=+a) Check the assumptions and conditions for inference.

Answered: 1 week ago