1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ira [324]
3 years ago
11

Pig Latin is a nonsense language. To create a word in pig Latin, you remove the first letter and then add the first letter and "

ay" at the end of the ford. For example, "dog" becomes "ogday" and "cat" becomes "atcay". Write a program named PigLatin that allows the user to enter a word and display’s the pig Latin version. For words which begin with vowel sounds or silent letter, one just adds "yay" to the end. Examples are:  "eat" → "eatyay"  "omelet" → "omeletyay"  "are" → "areyay" Another less common way some speakers may use a different ending for words starting with vowels is adding "way" (or "wa") to the end. Examples are:  "egg" → "eggway"  "inbox" → "inboxway"  "eight" → "eightway" You could use the split command to enter more than one word. Indicating delimiters char[] delimiterChars = { ' ', ',', '.', ':', ';', '\t' }; string[] words = text.Split(delimiterChars);
Computers and Technology
1 answer:
LUCKY_DIMON [66]3 years ago
7 0

Answer:

Hi there  Sandrathompson5661!  

Using Java as the language for implementation, the PigLatin translation program can simply be coded as shown below. The program uses the Scanner module in java utils package to prompt the user for input of word(s) and splits the input with any of the matching delimiters. The rule to swap the first character and append it to the end with an “ay” for a normal word, or the appending of “yay” for a vowel word, is then applied. The result is printed on the screen before the program exits.

Explanation:

import java.util.Scanner;

public class PigLatin {    

 public static void main(String[] args)     {        

   char[] delimiterChars = { ' ', ',', '.', ':', ';', '\t' };        

   String[] words_array;        

   Scanner words = new Scanner(System.in);        

   System.out.println("Please enter a word (for multiple words use any of the following delimiters {' ', ',', '.', ':', ';', '\t' }): ");        

   String input_words = words.nextLine();        

   words_array = input_words.split("[,\\s\\-:.;' '\\\t]");  

   System.out.println("PigLatin translation: ");        

   for (int i=0; i<words_array.length; i++) {

     System.out.println(makePigLatin(words_array[i]));        

   }    

 }      

 public static String makePigLatin(String word)     {        

    String vowels = "aeiou";        

    if (vowels.indexOf(Character.toLowerCase(word.charAt(0))) != -1) {          

       word = word + "yay";        

    }        

    else {          

       word = word.substring(1, word.length()) + word.charAt(0) + "ay";        

    }        

    return word;      

 }

}

You might be interested in
What type of network access control uses Active Directory to scan a device to verify that it is in compliance?
Komok [63]

Answer:

Agentless NAC

Explanation:

An active directory is a kind of storage service that holds data of objects like user credentials, resource location etc, for permission and network access authentication.

Network access control is a form of computer network security that integrates security technology like antivirus, intrusion detection and prevention systems etc to system authorisation and authentication processes to control access to a network.

An agentless network access control uses the active directory to scan devices to confirm its compliance to security policies.

3 0
4 years ago
Who has a brainpop acct. can i pls use it !
RSB [31]

Answer:

Союз нерушимый республик свободных

Сплотила навеки Великая Русь.

Да здравствует созданный волей народов

Единый, могучий Советский Союз!

Славься, Отечество наше свободное,

Дружбы, народов надежный оплот!

Знамя советское, знамя народное

Пусть от победы, к победе ведет!

Сквозь грозы сияло нам солнце свободы,

И Ленин великий нам путь озарил.

Нас вырастил Сталин - на верность народу

На труд и на подвиги нас вдохновил.

Славься, Отечество чаше свободное,

Счастья народов надежный оплот!

Знамя советское, знамя народное

Пусть от победы к победе ведет!

Skvoz grozy siialo nam solntse svobody,

I Lenin velikij nam put ozaril.

Nas vyrastil Stalin - na vernost narodu

Na trud i na podvigi nas vdokhnovil.

Slavsia, Otechestvo chashe svobodnoe,

Schastia narodov nadezhnyj oplot!

Znamia sovetskoe, znamia narodnoe

Pust ot pobedy k pobede vedet!

Мы армию нашу растили в сраженьях,

Захватчиков подлых с дороги сметем!

Мы в битвах решаем судьбу поколений,

Мы к славе Отчизну свою поведем!

Славься, Отечество наше свободное,

Славы народов надежный оплот!

Знамя советское, знамя народное

Пусть от победы к победе ведет!Explanation:

8 0
3 years ago
Who is credited with writing Google's famous page ranking search algorithm?
vaieri [72.5K]
Larry page is the correct answer :)
4 0
3 years ago
Corona and app inventor can be used to develop ________.
Sidana [21]
<span>Corona and app inventor can be used to develop apps for smartphones. Corona can be used to build both games and apps from major platforms like iOS, Android, Kindle, Apple TV, Android TV, macOS, and Windows. App Inventor was originally provided by Google and is now maintained by MIT.</span>
3 0
4 years ago
What legal punishment can people face for plagerism
Maru [420]
They can get a fine.
5 0
3 years ago
Other questions:
  • 1. Orthographic Drawings are used to express ideas that are more complicated. Explain the purpose of the different views and the
    7·1 answer
  • the piece of hardware that contains the circuitry that processes the information coming in to the computer
    13·1 answer
  • Write a statement that outputs variable numObjects. End with a newline.
    6·1 answer
  • 3.3 Code Practice: Question 1
    15·1 answer
  • Can anybody answer this
    11·1 answer
  • Anyone has any ideas for a gaming setup i can buy for christmas. Something with high framing rates (monitor included) for about
    15·1 answer
  • Can someone find out what this binary number thing is. Just find out the message, I'm having a difficult time
    13·1 answer
  • Which feature is not in ms PowerPoint​
    12·1 answer
  • 1. Write the full forms of the following.
    5·2 answers
  • A security operation center (SOC) analyst investigates the propagation of a memory-resident virus across the network and notices
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!