answer.
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
STatiana [176]
2 years ago
6

reAay ouyay aay hizway ithway igPay atin?Lay? (Translated: "Are you a whiz with Pig Latin?") Write a program that converts an En

glish phrase into a pseudo-Pig Latin phrase (that is Pig Latin that doesn’t follow all the Pig Latin syntax rules). Use predefined methods of the Array and string classes to do the work. For simplicity in your conversion, place the first letter as the last character in the word and prefix the characters "ay" onto the end. For example, the word "example" would become "xam-pleeay," and "method" would become "ethodmay." Allow the user to input the English phrase. After converting it, display the new Pig Latin phrase.
Computers and Technology
1 answer:
Phoenix [80]2 years ago
3 0

Answer:

Check the explanation

Explanation:

package com.prt.test;

package com.prt.test;

  import java.util.Arrays;

  import java.util.Scanner;

  public class StringEncryption {

      public static void main(String[] args)

      {

  try{

          String concatedString1="";//testing();

          StringBuffer encryptedString=new StringBuffer();

Scanner scanner = new Scanner(System.in);

         

          System.out.println("enter the string ");

         

          String userInput = scanner.nextLine();// to read the string

         

          String[] words=userInput.split("\\s");//to split the words if user enter the string with period

         

          for(String word:words)

          {

              int numberOfSpacesadd=1;

              String subs=word.substring(0, 1);//to split the first letter

              String s1=word.substring(1);//to split the after the first letter

              String concatedString=s1+subs;

              concatedString1=concatedString+"ay";//to add the adding phrase

              String addSpace = String.format("%"+ numberOfSpacesadd +"s", " ");//for adding the space after the word

                 

              encryptedString.append(concatedString1+addSpace);

             

          }

         

System.out.println(encryptedString.toString().trim()+"?");

  }catch(Exception e)

  {

      System.out.println(" try another time");

  }  

      }

  }

 

Output :

enter the string

Are You a Whiz with Pig Latin?

reAay ouYay aay hizWay ithway igPay atin?Lay?

You might be interested in
The Online Shopping system facilitates the customer to view the products, inquire about the product details, and product availab
jeyben [28]

Answer:

see explaination

Explanation:

We will consider the five Actors in the prearranged Online shopping software system:

Customer:

The scheme allows the customer to do below mention actions:

View goods and inquire about the niceties of products and their ease of use.

To create version to be able to purchase invention from the structure.

Browse crop through search category or shortest search alternative.

Place order for the necessary crop.

Make sum for the order(s) positioned.

Payment System:

Payment system allows client to pay using subsequent two methods:

Credit card.

PayPal.

Seller:

System allow seller to perform underneath actions:

Place the foodstuffs for selling under apposite product category.

Create account to happen to a member.

Administrator:

Following actions are perform by Admin:

Manage the goods posted in the system.

Modify existing manufactured goods categories or add novel categories for foodstuffs.

Site Manager:

System privileges Site director with the following role in the system:

View information on:

Orders Placed by customer

Products added by seller

Accounts created by users

check attachment

3 0
2 years ago
Write a function called add_tuples that takes three tuples, each with two values, and returns a single tuple with two values con
Leni [432]

In Python, tuples are indeed a data structure that also stores an ordered sequence of unchanging values, and following are the Python program to the given question:

Program Explanation:

  • Defining a method "add_tuples" that takes three variables "firstTuple, secondTuple, thirdTuple" into the parameter.
  • After accepting the parameter value a return keyword is used that adds a <em><u>single tuple with two values</u></em> and returns its value into the form of (x,y).
  • Outside the method, two print method is declared that calls the above method by passing value into its parameters.

Program:

def add_tuples(firstTuple, secondTuple, thirdTuple):#defining a method add_tuples that takes three variable in parameters

   return firstTuple[0]+secondTuple[0]+thirdTuple[0],firstTuple[1]+secondTuple[1]+thirdTuple[1] #using return keyword to add value

print(add_tuples((1,4), (8,3), (14,0)))#defining print method that calls add_tuples method takes value in parameters

print(add_tuples((3,2), (11,1), (-2,6)))#defining print method that calls add_tuples method takes value in parameters    

Output:

Please find the attached file.  

Learn more:

brainly.com/question/17079721

4 0
2 years ago
The ratio of Chris an iood Dom's ages is
irinina [24]

Answer:

28 years

Explanation:

Let's represent present age of Chris and Dom as C and D respectively. Then since ratio of present age of Chris and Dom is 3:4. Therefore,

\frac{C}{D}=\frac{3}{4}

C=\frac{3}{4}D   ...(1)

Now, it is given that in 7 years their age ratio will become 4:5. Therefore,

\frac{C+7}{D+7}=\frac{4}{5}

5C+35=4D+28\\

Using value of C from equation(1),

5\times\frac{3}{4}D-4D=28-35

15D-16D=-28\\-D=-28\\ D=28

Thus, present age of Dom is 28 years.

8 0
2 years ago
Go to the Creamy Ice Corporation passage on the next page. Insert the trademark sign after the word “Corporation'' in the first
GuDViN [60]

Answer:

v

Explanation:

because it is

5 0
2 years ago
Suppose a linked list of 20 nodes. The middle node has a data –250. Write the pseudocode to replace the middle node of the linke
dexar [7]

Answer:

The middle node has a data –250. ... Write The Pseudocode To Replace The Middle Node Of The Linked List With ... Assume That The List's Head Pointer Is Called Head_ptr And The Data For The New Node Is Called Entry ... Assume that the list's head pointer is called head_ptr and the data for the new node is called entry ...

Explanation:

4 0
2 years ago
Read 2 more answers
Other questions:
  • Write a method named quarterstodollars. the method should accept an int argument that is a number of quarters, and return the eq
    13·2 answers
  • In the State of Florida, the penalties for DUI become progressively more severe depending upon the number of convictions and the
    6·3 answers
  • Marissa works at a company that makes perfume. She noticed many samples of the perfume were not passing inspection. She conducte
    6·2 answers
  • An online game is played with two dice. In this context, explain what is meant by decomposition in a simple way.
    15·1 answer
  • Write a program in c or c++ to perform different arithmeticoperation using switch statement .the program will take two inputinte
    10·1 answer
  • Your reputation and credibility will be immediately destroyed if your website contains?
    8·2 answers
  • Consider the following code: x = 17 y = 5 print (x % y) What is output?
    10·1 answer
  • (a) Show how to use (the Boolean formula satisfiability program) satisfiable num (and substitute) to find a satisfying assignmen
    9·1 answer
  • 10. There is repeated code in these onevent blocks. Choose the correct code for the updateScreen() function which would be calle
    11·1 answer
  • Write a program that uses the Purchase class in 5.13. Set the prices to the following: Oranges: 10 for $2.99 Eggs: 12 for $1.69
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!