Count the number of words in the sentence

Assignment Help Macroeconomics
Reference no: EM131271578

Write your code in the file PigLatin.java. Your code should go into a method with the following signature. You may write your own main method to test your code. The graders will ignore your main method:

public static String translate (String original){}

Write your code in the file WordCount.java. Your code should go into a method with the following signature. You may write your own main method to test your code. The graders will ignore your main method:

public static int countWords(String original, int minLength){}

Your method should count the number of words in the sentence that meet or exceedminLength (in letters). For example, if the minimum length given is 4, your program should only count words that are at least 4 letters long.

Words will be separated by one or more spaces. Non-letter characters (spaces, punctuation, digits, etc.) may be present, but should not count towards the length of words.

Hint: write a method that counts the number of letters (and ignores punctuation) in a string that holds a single word without spaces. In your countWords method, break the input string up into words and send each one to your method.

"Pig Latin" is a fake language used as a children's game. A word in English is "translated" into Pig Latin using the following rules:

  • If the English word begins with a consonant, move the consonant to the end of the word and add "ay". The letter Y should be considered a consonant.
  • If the English word begins with a vowel (A, E, I, O, or U), simply add "way" to the end of the word.

(This is a simplified dialect of Pig Latin, of course.)

Write your method so that it returns the pig latin translated original string. You may assume that the input does not contain digits, punctuation, or spaces. The input may be in any combination of uppercase or lowercase. The case of your output does not matter.

Reference no: EM131271578

Questions Cloud

Championed sustainable supply chain practices : Find an organization that has championed sustainable supply chain practices. Highlight the sustainability achievements of the organization you’ve chosen and provide a convincing argument at to why your organization is a sustainability “Champion.”
Develop a comprehensive analysis using npv : In this assignment, use the information above to develop a comprehensive analysis using NPV, Payback Method, and IRR to develop a recommendation on replacing the existing equipment with a new computerized version
Computer program that computes the ticket price : A local art gallery has tasked you with writing a computer program that computes the ticket price based on the visitor's age. Because of the high value of the art exhibits, only visitors 12 years and older are allowed in the art gallery.
Analyzing projects by determining longest sequence of tasks : CPM, a technique for analyzing projects by determining the longest sequence of tasks (or the sequence of task with the least slack) through a project network Organizations today are also increasingly using virtual project management teams. They are p..
Count the number of words in the sentence : Your method should count the number of words in the sentence that meet or exceedminLength (in letters). For example, if the minimum length given is 4, your program should only count words that are at least 4 letters long.
What are the pros and cons of this law : The Lilly Ledbetter Fair Pay Restoration Act of 2009 changes the statute of limitations for a claim under Title VII and the EPA for an unjustified pay difference between male and female. The Act resets the statute every time a person received an uneq..
What key competencies have you already realized in journey : What key competencies and accomplishments have you already realized in the journey of your life and work? What other interests and talents do you have that you are passionate about but you have not fully developed?
How a business function with which you are familiar : Provide and discuss an example of how a business function with which you are familiar with (e.g. sales, marketing, finance, operations/production, accounting, human resources) utilizes information Technology for operational and/or strategic purpos..
Improve and modify few things in the given room planning : Improve and modify few things in the given Room Planning. - Look at the project resource "Room Planning Information". The dimensions of your room do not match that of the space Carrie and Fred have.

Reviews

Write a Review

 

Macroeconomics Questions & Answers

  What are the trade-offs that bag by faces in chooseing

Baby copy company is a worldwide producer of copy machines. It manufactures 10 different copieers, ranging from low-end desktop copiers that sell for a few hundred dollars to high volume document machines that retail for over $200,000.

  Explore how firms in monopolistic competition differentiate

What is monopolistic competition and why/where is it different from perfect competition Explore how firms in monopolistic competition differentiate their products or services to generate a market niche and gain more control over their pricing.

  Show how consumers are harmed

If government imposes on the firms in a polluting industry penalties(taxes) that exceed the actual value of the damages done by the pollution, the result is an inefficient and unfair imposition of costs in those firms and on the consumers of their..

  What fiscal policy and monetary policy would be appropriate

What is the "current macroeconomic situation" in the U.S. (e.g. is the U.S. economy currently concerned about unemployment, inflation, recession, etc.)  What fiscal policies and monetary policies would be appropriate at this time

  What is the equivalent present value of the following

what is the equivalent present value of the following series of payments 7000 the first year 6500 the second year 6000

  Microeconomic environment of corporate operations

1. Analyze the microeconomic environment of corporate operations. 2. Assess the impact of regulatory considerations on economic decisions. 3. Assess the impact of ethical considerations on economic decisions.

  What is the liquidity premium on this bond

One year T-bill rates over the next 4 years are expected to be 3%, 4%, 5%, & 5.5%. If 4-year T-bonds are yielding 4.5%, what is the liquidity premium on this bond?

  Determine marginal productivity of labor

To hire workers, suppose that Mitsubishi must pay the competitive hourly wage of ¥1,470. In the study of its production process and markets where capital is procured, suppose that Mitsubishi determines that its marginal productivity of capital is ..

  Calculate the amount of interest earned

Q1. Calculate the principal that will earn a total of £2,535 in 4 years at 3¼% simple interest per annum. Q2. Calculate the amount of interest earned in the first year

  Overpaying for the product

If you take out money to buy a home, a car etc. you will always be overpaying for the product that you are receiving. Generally, an ordinary person is not getting a 1% loan from the federal reserve, and they sure are not paying it back with the sp..

  Expenditures for an elastic demand curve

What is the relationship between the change in price and total expenditures for an elastic demand curve?

  How rising consumer credit can stimulate an expansion of uk

The question is from Economics and the question is explain about interpreting an article. The article's title is "It's official: The economy is shrinking".

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd