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
Verdich [7]
3 years ago
7

Write a program that reads a sentence as input and converts each word to "Pig Latin". In one version of Pig Latin, you convert a

word by removing the first letter, placing that letter at the end of the word, and then appending "ay" to the word. Here is an Example: English: I SLEPT MOST OF THE NIGHT Pig Latin: IAY LEPTSAY OSTMAY FOAY HETAY IGHTNAY
Computers and Technology
1 answer:
OLga [1]3 years ago
6 0

Answer:

The program statement will be written using Microsoft Visual C# Console

string val,vall;

Console.Write("Enter Sentence :");

vall = Console.ReadLine();

val = vall.ToUpper();

string[] words = val.Split(' ');

string[] word = new string[words.Length];

int kount = 0;

string newword = string.Empty;

for (int i = 0; i < words.Length; i++)

{

if (words[i].Length > 1)

{

char[] ch = words[i].ToCharArray();

for (int j = 1; j < words[i].ToCharArray().Length; j++)

{

newword += ch[j];

}

newword += ch[0] + "AY ";

word[kount] = newword;

kount++;

}

else

{

newword += words[i] + "AY ";

kount++;

}

}

Console.WriteLine(newword);

Console.ReadLine();

Explanation:

The first line declares two variables of string data-type

Line 2 prints "Enter Sentence" without the quotes

Line 3 accepts the sentence to be converted to Latin

Line 4 converts the sentence to uppercase

Line 5 splits the sentence word by word

Line 6 creates an array variable

Line 7 creates and initialise a variable kount to 0

Line 8 creates another variable newword,this variable would be used as output variable

Line 9 creates an iterative process

Line 11 checks if the length of a particular word in the sentence is a greater than one

If yes,

Line 13 to 20 Moves the first letter to the last then appends AY then saved in newword variable

If no,

Line 24 - 25 appends AY directly to the word currently in the iteration then saved in newword variable

Line 28 prints the Latin word equivalent of the input sentence.

You might be interested in
Assume that a kernel is launched with 1000 thread blocks each of which has 512 threads. If a variable is declared as a shared me
Alex

Answer:

The answer to this question is the option "B".  

Explanation:

In this question, the answer is option B which is 1,000 because the kernel is a central part of an operating system. kernel manages the computer and the hardware operations. most especially memory and CPU time. It also sheared a memory variable is allocated to thread blocks. That's why the answer to this question is 1,000.

7 0
3 years ago
Any fact or set of facts, such as the words in a letter to a friend or the notes in a song, can become computer ____.
Alina [70]

I think the answer is... data

3 0
3 years ago
How does Technology impact any profession or occupation?
Brrunno [24]

Technology can create or dimish occupations.

Technology can also make the job easier

8 0
3 years ago
How do you innovate or improve a product?
In-s [12.5K]

Answer:in order to innovate or improve a product you need to have an idea

Explanation:

5 0
3 years ago
I need help please and thank you
Evgen [1.6K]

Answer:

Explanation: For "BEST way to handle the situation," try Option 1, because it would possibly help them or make the Technical Support Representative do less work.

For "WORST way to handle the situation," Option 4 would be the best because you're basically just hanging up on the person.

5 0
3 years ago
Other questions:
  • Which of the following domain types is most trustworthy 1) .com 2) .tv 3).org 4) .edu
    15·2 answers
  • What can search the Internet and select elements based on important words?
    6·2 answers
  • If I wished to insert a hyperlink from text in my document to my company website, what type of link would I insert?
    9·1 answer
  • Mkdir() is the command in Java to create a new directory.<br> a) True b) False
    10·1 answer
  • To whom the script most important
    13·1 answer
  • Match each proofreading mark to the expected result.
    10·1 answer
  • Who was the father of computer​
    10·1 answer
  • FIRST TO Answer for free brainlest. GOG GOGOGO
    6·1 answer
  • Large and fast disks should be used for as doing so will ensure work is done as quickly as possible?
    8·1 answer
  • What are the two protocols used most often with iot devices? (select two. )
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!