Write a program average java just prints the strings

Assignment Help English
Reference no: EM13198979

As discussed in Section 7.4 of the text book, when you run a Java program called Foo, anything typed on the command line after "java Foo" is passed to the main method in the args parameter as an array of strings.

1. Write a program Average.java that just prints the strings that it is given at the command line, one per line. If nothing is given at the command line, print "No arguments".

2. Modify your program so that it assumes the arguments given at the command line are integers. If there are no arguments, print a message. If there is at least one argument, compute and print the average of the arguments. Note that you will need to use the parseInt method of the Integer class to extract integer values from the strings that are passed in. If any non-integer values are passed in, your program will produce an error, which is unavoidable at this point.

3. Test your program thoroughly using different numbers of command line arguments.

Reference no: EM13198979

Questions Cloud

Examine an example of an art direction : Analyzes an example of an Art Direction, Production Design, or type of Media asset that interests you. Discuss why you have chose it, and how it can fit into your digital portfolio.
Find the dimensions of the poster with the smallest area : find the dimensions of the poster with the smallest area. Note: The answer to this problem requires that you enter the correct units.
What is the domain and range of each function : Examine several newspapers and magazines and describe at least 3 examples of functions that you find. What is the domain and range of each function?
What combination of vehicles and mechanics should he employ : The owner of a small car-rental service is trying to decide on the appropriate numbers of vehicles and mechanics to use in the business for the current level of operations. He recognizes that his choice represents a trade-off between the two resou..
Write a program average java just prints the strings : Write a program Average.java that just prints the strings that it is given at the command line, one per line. If nothing is given at the command line, print "No arguments".
How should she proceed : of a circular lake with radius 2 mi wants to arrive at the point C diametrically opposite A on the other side of the lake in the shortest possible time. She can walk at the rate of 4 mi/h and row a boat at 2 mi/h. How should she proceed?
What is the perimeter of this field : A rectangular field has an areaof exactly 1 square mile. if the field has a length of 250 yards and 3 inches, what is the width of the field? Give your answer in feet and inches, and round to the nearest inch. What is the perimeter of this field?
Find the area of the region that lies inside the first curve : find the area of the region that lies inside the first curve and outside the second curve.
How far has the car moved : A car traveling at 45 miles per hour is brought to a stop, at constant deceleration, 138 feet from where the brakes are applied. (Give your answers correct to the nearest whole number.)

Reviews

Write a Review

English Questions & Answers

  Write a profile

Write a profile on bishop poleni.

  Education system

Write a rearch paper on education system

  Write an report

The U.S. President Barack Obama said America can "win the future" by rebuilding its manufacturing sector (on June 8, 2011, after visiting an automotive training center at a community college in Virginia, outside Washington). Do you agree, and why?

  Discuss the accuracy of this statement

'Consideration does not have to be adequate or commercially realistic, nor does it need to be expressed in monetary terms, it merely needs to be "sufficient".' Discuss the accuracy of this statement.

  Write an essay on the youngest billionaire

Write an essay on the youngest billionaire

  Transformational leadership in the public sector

The more hierarchical an organization's authority structure, the lower the reported practice of transformational leadership behaviors.

  Modal verbs or modal constructions

Identify all the modal verbs or modal constructions in the passage

  Write a latter to mom thanking to adopting and caring

Write a latter to mom thanking for adopting and caring,

  Ways of knowing & authority in your discipline

To explore and become familiar with your discipline; to prepare you for your major researched essay.

  Writing an effective business letter

Prepare a letter in either block or modified block format, addressed to your employer or supervisor and copied to your marker.

  Discuss the kingdom of saudi arabia

Discuss the Kingdom of Saudi Arabia

  Developing an annotated bibliography

Developing an annotated bibliography

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