Write methods in java for a program

Assignment Help Business Management
Reference no: EM132243035

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

Questions Cloud

Marketing product or service in new international market : What aspects of cultures we should understand before marketing a product or service in a new international market
Create html documents : Can someone help me to create these HTML documents / images please:
Preparing an analytical report : Preparing an Analytical Report: Evaluate possible alternative solutions, and make a recommendation.
Critique intel segmentation with respect to existing : Critique Intel’s segmentation with respect to existing, emerging and imagined market opportunities.
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.
Dignity healthcare-description of project-market analysis : dignity healthcare: Brief description of the project (must have instructor approval). Market analysis
State the benefits and costs of voluntarily adopting hiring : State the benefits and costs of voluntarily adopting hiring and promotion practices designed to diversify the workforce.
Write a function named hasfinalletter that takes : a. Write a function named hasFinalLetter that takes two parameters
Positioned in the emerging growth areas they identified : Analysis of these segments will then focus on target companies well positioned in the emerging growth areas they identified.

Reviews

Write a Review

Business Management Questions & Answers

  Evaluate the potential impact of the updated facility

Evaluate potential impact of updated facility and new therapy services on potential improvements in patient satisfaction and developing new marketing share.

  Optimal level of output produced by the monopolist

The demand for a good produced by a firm has been reliably measured by P = 100 - 5Q, output Q is measured in thousands of units. If the total cost function is given by: C = 10Q, what is the optimal level of output produced by the monopolist?

  Analyze the effectiveness of the steps to change culture

Choose a company where the culture is important and describe what this company did to change the culture to make it better overall, not just a better place to work, but financially as well. Analyze the effectiveness of the steps to change culture

  Performance management in organizations

Analyzing the role of coaching and performance management in organizations.

  Servant leadership mentality in an organization

In a 150-300 word post, discuss ways leaders and managers can create a servant leadership mentality in an organization. What are the pros and cons of servant leadership?

  Write e-mail to cole prewarski requesting answer to question

Write an e-mail to Cole Prewarski ([email protected]) requesting answers to several questions and inviting him to a meeting.

  Name resolution process a windows client takes

1) Describe DNS name resolution process a windows client takes. Why is it necessary to know the steps?

  What other factors should invincibility systems

1. Besides the factors identified, what other factors should Invincibility Systems take into account in its HR planning?

  Key points of evaluating a company diversification strategy

Question 1: What are the key points of evaluating a company's diversification strategy? Why are these important? Question 2: What are the differences between related and unrelated diversification strategies? Please list an example or two

  Outline and critically evaluate the leadership

What is the main drive of change within an organization or industry with which you are familiar? Discuss and critically evaluate what the likely resistors

  Explain a management principle

Giving justifications, propose and explain a Management Principle that you think can be used by organizations operating in fast changing business environment.

  Offer two additional considerations in capital budgeting

Imagine the producers of this video ask you to appear in the video to offer two additional considerations in capital budgeting decisions.

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