Java for a program that analyzes an arbitrary number

Assignment Help Basic Computer Science
Reference no: EM132253150

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

Questions Cloud

Explain why organizational structures differ : Explain why organizational structures differ. Define and provide an example of the four reasons why structures differ.
Describe vendor managed inventory : Describe vendor managed inventory (VMI). How is it related to outsourcing? Cite an example from your experiences as a shopper.
Describe key elements of the culture of southwest airlines : Describe the key elements of the culture of Southwest Airlines and explain why these cultural elements are essential to Southwest Airlines' success.
Help me to create these html documents : Can someone help me to create these HTML documents / images please:
Java for a program that analyzes an arbitrary number : 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.
What are the major factors that determine supply of savings : What are the major factors that determine the supply of savings? What are the effects of employment protection laws? Please provide details.
Insulation and material selection in low energy building : Litrature Report Writing - Insulation, material selection, window selection and PCM ( phase change material) in low energy building
Describe the major shifts in people management required : Describe the major shifts in people management required when executing a critical chain project (vs. a traditional critical path project).
Create a stakeholder needs analysis : Develop a stakeholder needs analysis. In this assignment, you will create a stakeholder needs analysis using the template provided with this week's resources.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Determine the overhang length b

the coefficient of static friction between the chain and the inclined plane is , determine the overhang length b so that the chain is on the verge of slipping up the plane µs = tanθ The chain weighs w per unit length.

  Compare and contrast between bluetooth and nfc

Compare and contrast between Bluetooth and NFC. Please, also, do we really need both? And why Can't Bluetooth accomplish the functions of NFC?

  Computer architecture is the combination of software and

computer architecture is the combination of software and hardware that is organized in such a fashion as to deliver the

  Where in a max-heap might the smallest element reside

Describe a simple modification to the BST that will allow it to easily support finding the Kth smallest value in Θ(log n) average case time. Then write a pseudo-code function for finding the Kth smallest value in your modified BST.

  What is the expected average mips rate

What factors limit the speed of an electrically based processing device ?What is a font? What is pont size?

  Who is correctly saving their files to a cd

When prompted, Mary Ann will click on Burn files to disc, indicate how she'll use the files, click on Burn to disc, and indicate the recording speed. Who is correctly saving their files to a CD?

  Determining the long-run equilibrium

Can the market in which this firm operates be in a long-run equilibrium? Briefly explain.

  Total compensation for the three highest paid officers

What is the total compensation for the three highest paid officers for Walmart last year(including the value of stock options and other benefits)?

  The term means making an organization ready

QUESTION 1 The term means making an organization ready for possible contingencies that can escalate to become disasters.QUESTION 2 Mainframes are perceived as being more robust than n-tier server architectures.

  How many packages of butter and margarine will he choose

If butter costs $2 per package, while margarine costs only $1, and Bill has a $20 budget to spend for the month

  Easy to understand assignment paper

Please provide an easy to understand assignment paper in APA format and quality references shown in body of paper and on the reference page for paper. See assignment instructions 4 below for further information on assignment instructions for paper..

  Unemployment and inflation important for policy makers

Why is the hypothesized trade-off between unemployment and inflation important for policy makers?

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