Write methods in java for a program

Assignment Help Business Management
Reference no: EM132255276

Your task is to write methods in JAVA for a program that analyzes an arbitrary number of strings passed as arguments on the command line. Like with many large projects, some of the code has been written for you, and you are not allowed to change it. Instead, you are constrained to filling in certain methods, that must operate to fulfill not only individual-method unit tests, but tests that cover larger swaths of code.

As an example, consider that a user calls the program from the terminal without any arguments:

$ java edu.wit.cs.comp1050.PA3a

Please supply at least one argument at the command line.

That is, you will be writing verification that there is at least one argument supplied! Now let's consider a valid example:

$ java edu.wit.cs.comp1050.PA3a hello world!

Arguments (2, no duplication): hello world!

Length: total=11, avg=6

Shortest (5): <hello>

Longest (6): <world!>

Average (6): <world!>

Now you can see the program in action, but perhaps not all the pieces, so another:

$ java edu.wit.cs.comp1050.PA3a I see a little silhouetto of a man Scaramouche Scaramouche will you do the Fandango Thunderbolt and lightning very very fright'ning me

Arguments (22, has duplication): I see a little silhouetto of a man Scaramouche Scaramouche will you do the Fandango Thunderbolt and lightning very very fright'ning me

Length: total=113, avg=5

Shortest (1): first=<I>, last=<a>

Longest (11): first=<Scaramouche>, last=<fright'ning>

Average (5): none

The program produces outputs that counts the overall and average length (rounded to the nearest integer), checks for duplication, and outputs the first and last arguments that have the shortest, longest, and average lengths.

The following methods have been implemented completely, and you are NOT to change them:

  • main: validates input, produces program output
  • firstOfLength/lastOfLength: call a common utility method (that you WILL implement) to find an element of a particular length
  • firstLongestElement/lastLongestElement: call a common utility method (that you WILL implement) to find the longest element
  • firstShortestElement/lastShortestElement: call a common utility method (that you WILL implement) to find the shortest element

The remaining methods must be implemented by you, as guided by the Javadoc and JUnit tests.

Reference no: EM132255276

Questions Cloud

Produce an app that generate quotes for life annuities : ACT 394 Programming Project - The goal of this project is to produce an app that generate quotes for life annuities
How the identified telehealth technology can be used : Telehealth encompasses a wide range of basic to complex health care delivery options, with an equally expansive array of technologies to employ.
Display an image that has a border of size : Can someone help me to create these HTML documents / images please:
In the attribution leadership model : In the Attribution Leadership model, to what does low consensus refer? which of House’s four leader behaviors could you perform least well?
Write methods in java for a program : Your task is to write methods in JAVA for a program that analyzes an arbitrary number of strings passed as arguments on the command line
Identify and describe a technology element : Describe at least one technology that may be used as a solution to the patient situation or condition described in your case.
Some examples of self-service retailers : What are some examples of self-service retailers?
What is quality and its importance to project success : What is quality and its importance to project success and how to explain quality management planning
Service operations often face more difficulty in planning : Service operations often face more difficulty in planning than their manufacturing counterparts.

Reviews

Write a Review

Business Management Questions & Answers

  Successful it project managers

Why might companies today develop IS operational plans that cover only one year? What types of project staffing skills have been identified as important for successful IT project managers?

  The globalization of markets and production

Explain how changes in technology contributed to the globalization of markets and production? Would the globalization of production and markets have been possible without these technological changes?

  Ethical theories of causality and acts of omissions

How do the ethical theories of causality and acts of omissions relate to patient safety? How do the ethical theories of causality and acts of omissions relate to organizational liability? What must organizations do to protect themselves from such lia..

  Help me define corporate social responsibility

Help me define corporate social responsibility.

  Problem regarding the utility maximizing choice

A consumer with an income of $240 is spending it all on 12 units of good X and 18 units of good Y. The price of X is $5 and the price of Y is $10. The marginal utility of the last X is 20 and the marginal utility of the last Y is $30. What should ..

  Analysis of the ethical implications of recommendation

A 3-4 paragraph explanation of the crisis that you selected and a crisis management response recommendation. Include an analysis of the ethical implications of that recommendation. Reference at least one scholarly peer-reviewed resource in your re..

  Sources of the economies of scale

From the list, select two firms from two different industries and discuss the likely sources of the economies of scale that underlie their large size. If you are not the first individual to post to the discussion thread, please try to select compan..

  Difference between the contract price and the market price

May Sun Maid recover from Victor the difference between the contract price and the market price before the end of the current crop year?

  Optimal order amount to specify

Now use the simulation model to come up with the optimal order amount to specify in the contract from the following possibilities: 160, 165, 170, 175, 180, 185, 190 and 195.

  In distributed bargaining why is obtaining information

in distributed bargaining why is obtaining information about the opponents target and resistance points important?q1 in

  Exhibit the duties of transformational leadership

Explain how Human Resources Professionals exhibit the duties of transformational leadership.

  Keys to great customer service

What are the 12 keys to great customer service?

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