Arbitrary number of strings

Assignment Help Business Management
Reference no: EM132244950

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: EM132244950

Questions Cloud

Describe how an information system : Define one business process and describe how an information system can be used in that process to collect data, create information, and aide in the decision
Used for planning organized sales dialogue presentation : Discuss the nine components in the sales dialogue template that can be used for planning an organized sales dialogue presentation.
Same format used on the front of envelopes : An HTML document that displays the numbers 1 - 10, each number being a different color.
Describe your vision for your career once you have completed : Address the impact completing this degree will have on meeting the greater social good in your industry and within the community.
Arbitrary number of strings : 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.
Create a one to two-page resume appropriate for the job : Create a one to two-page resume appropriate for the job you selected. When creating this resume, think of its appearance and job information included.
Complement hexadecimal number : How to convert the signed decimal number +135 into a two's complement hexadecimal number?
Process of salt triage method of lifesaving interventions : Describe process of SALT triage method of lifesaving interventions. Analyze and assess disaster scenario and apply SALT triage for your selected threat scenario
List of non-empty strings and a string of upper : Create three test cases, each consisting of a list of non-empty strings and a string of upper and/or lower case letters, for your function in Problem 1a

Reviews

Write a Review

Business Management Questions & Answers

  Porter generic strategies

Being 'all things to all people' is a recipe for strategic mediocrity (Porter 1985). Using Porter's Generic Strategies, critically evaluate this statement.

  Research the topic of global warming

1. One quote from a 2015-16 news article arguing that there has been no global warming in the last few years (in spite of predictions); and 2. One quote from a 2015-16 news article arguing that there has been global warming in the last few years (in ..

  Define perception

Run the Making Decisions in Business conditions simulation at least once to ensure that you are familiar with the several decision points in the simulation,

  Best represent producer-producer rivalry

Does this situation best represent producer-producer rivalry, consumer-consumer rivalry, or consumer-producer rivalry? Explain.

  Illustrate what grabs the readers attention

Illustrate what will you say and explain how will you say it so it grabs the readers' attention and the message "sticks"?

  Determine key advantages of using buy american requirements

Determine the key advantages and disadvantages of using the Buy American Requirements with the navigation system that both VectorCal and your company produce. Justify your response.

  Failure and success in application software

Case Study: Wolf Peak International: Failure and success in application software for the small to medium enterprise

  What recommendations would make to management

Conduct a search using GlobalEdge and other sources to identify the current import policies, tariffs, and restrictions in these countries

  Explanation to ethical issues question

Illustrate environmental science and environmental ethics. Examine the relationships between them.

  Elaborate on some of the complex issues

Elaborate on some of the complex issues health care administrators today are facing in making financial and strategic decisions. provide citation and reference.

  Detailed explanation to transformational leadership

Detailed Explanation to Transformational Leadership and briefly explain a possible group or organization to belong and If you were the leader of this group.

  Marketing communications-advertising-promotions

Marketing, media, and promotional messaging can sometimes pose problems for companies, endorsers or even individual product lines.

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