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

Previous Q& A

  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.)

  Explain the bail system''s effectiveness

Describe the bail system's effectiveness.• Identify the positives and negatives of the bail system.

  What factors (determinants) cause the ad curve to shift

Explain and show graphically how the self-correcting(self-djusting) mechanism works in a recessionary and in an infationary gap. Does the ecoomy have a self-correcting mechanism. What factors (determinants) cause the AD curve to shift

  Draw frequency polygons for each of the four distributions

Draw frequency polygons for each of the four distributions (assume they are normal) with the raw scores indicated for all six of the standard deviation units.

  Estimate the maximum possible error in the computed product

Four positive numbers, each less than 90, are rounded to the first decimal place and then multiplied together. Use differentials to estimate the maximum possible error in the computed product that might result from the rounding.

  What is the length of the loan

A $60,000 loan was taken out at at 6.75% interest rate. The monthly payment is $500. What is the length of the loan?

  What is the length of an edge of the base

the volume of a box with a square base and a height of 7in is 252 cubic in. what is the length of an edge of the base?

Reviews

Write a Review

 

Similar Q& A

  Write a report on hiv

Write a report on HIV (Human Immunodeficiency Virus)? Report should include the introduction of HIV virus, HIV Transmission, HIV IS NOT TRANSMITTED, HIV Progression and Symptoms, SYMPTOMS OF AIDS and HIV detection,

  Essay comparing continental, pragmatic, and analytic

Write a 350- to 700-word essay comparing Continental, Pragmatic, and Analytic philosophies.

  Define the interconnections between biography

Explored the interconnections between biography (slice of life), the social structure and culture. Utilized the sociological imagination concept in the document by including at least 4 TCOs plus 5 terms or concepts we have discussed throughout the ..

  Explain work environment in a fast food restaurant

What aspect of the social and work environment in a fast food restaurant would be of particular interest to a sociologist

  Synthesis essay of three of freakonomics and the real drug

an example of a synthesis essay on chapter three of freakonomics and the article The Real Drug Czar, and how the two have connections.

  What it was

I was adopted just a few weeks old and was raised in a very loving and nurturing family. I honestly, was very blessed with the family I "ended up with!" My sister was also adopted but from a different family.

  Please write 2 paragraphs in the monotheistic tradition

PLEASE WRITE 2 PARAGRAPHS  In the monotheistic tradition, how is the idea of the saint alike and different from what we have seen in the previous idea of the hero?

  Graduated cylinder

Prepare the molar enthalpy vs. concentration profile of ammonium chloride-water solution by preparing different amounts (mass) of ammonium chloride to be dissolved in the same volume of water.

  Define community and environmental factors

how to lay out the response to the request to format detailing how a human service organization will address statement of opportunity, impact of organizational structure, community and environmental factors

  Define the company or organization represented by the logo

Examine the visual identity (logo) example. Write a one to two page paper addressing the following questions: Do you recognize the company or organization represented by the logo?

  Maslow

Write a paper analyzing your agency or place of work and the motivation processes used within that workplace as identified with the following theories:

  Comments about each part

Comments about each part of this job package appear in the right margins of the document. A final comment and grade appear on the last page.

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