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
In the context of object-oriented programming a(n) is a template for a group of objects with similar characteristics.
MArishka [77]

A class is a template for a group of objects with similar characteristics.

An object-oriented programming uses objects, instead of <em>functions and logic </em>to model software designs.

In an object-oriented programming, there are:

  • Objects
  • Classes
  • Methods
  • Etc

Objects are what make up the object-oriented programming.

Similar objects are grouped together into classes

Hence, the text that completes the blank is class

Read more about object-oriented programming at:

brainly.com/question/22530356

7 0
3 years ago
Your users are calling the help desk, complaining that they are constantly losing work they have done on a document in Word. How
Natalka [10]

Listen to the story of what every had happening evaluate after learning what was happening to everyone, try to solve the problem.


Im not to sure how to explain this.

3 0
3 years ago
Read 2 more answers
................,...
docker41 [41]

Answer:

there's a comma

Explanation:

after all those periods

6 0
4 years ago
In a paragraph, describe in detail a practical real-world example of where you would implement a singly-linked list and why a si
frosja888 [35]

Answer:

travel

Explanation:

One real world example of a singly-linked list would be travel. Imagine that you want to take a trip to your nearest neighbor state. To do so you would need to take a 2 buses and a train, but you can't just take any or in any order you wish. You first need to take the first bus at your current location, get off at the train station, take that train to the final stop, get off and take the bus to the final destination. Meaning there is a sequence of connected events that you must follow in order to get to your destination and the same opposite sequence of events to get back. This is exactly like a singly-linked list.

3 0
3 years ago
Choose the parts of the browser window.
8_murik_8 [283]

Answer:

The answer is "Title bar".

Explanation:

The title bar is located on top of the screen, its color blue, which is used in browsers. It has the function, that shows the title of the web page, that you currently viewing, and other choices were wrong, which can be described as follows:

  • Enter bar is the wrong option because it is not a part of the browser.
  • The back button is also known as a backspace key which is used to delete so thing, which is written by keyboard, that's why it is wrong.
  • The forward bar is used in pipe in a module that's why it's incorrect.

4 0
3 years ago
Other questions:
  • Data bars describe a graphic element that
    9·2 answers
  • If you have a document that is relevant to more than one folder in your computer what should you do?
    8·1 answer
  • The growing network of physical objects that will have sensors connected to the Internet is referred to as the ________.
    13·1 answer
  • Minerals that contain the elements silicon and oxygen are called ______.
    7·1 answer
  • A ______ uses a web address to locate a website or a web page.
    9·1 answer
  • Why is my Brainly scanner not work​
    5·2 answers
  • How to implement switch statement in Python?
    11·2 answers
  • HELP PLEASE!!!!!!!!!<br> Please fix the coding! thanks I give brainliest
    5·1 answer
  • For quantitative data (e.g. the number of milligrams of a drug) coding your data involves?
    15·1 answer
  • write a recursive function that accepts an integer argument, n. the function should display n lines of asterisks on the screen,
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!