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

  Articles on health science literature

locate 2 peer-reviewed articles that discuss the relationship between Religion and Spirituality. One of these articles should originate in the Health Science literature.

  Identify tense/grammar

Can you identify Tense/grammar point of the following.

  Two thesis statements, tell what is wrong with each one

Choose two of the following thesis statements, tell what is wrong with each one, and revise each one to make it more effective

  Explain historical developments

Write a 1,050- to 1,400-word paper in which you describe the major historical developments of the U.S. courts. Be sure to outline the dual court system (state vs. federal) of the United States and analyze the correlation between the previously des..

  Define enforce environmental laws and regulations practical

Enforce Environmental Laws and Regulations Practical Exercise .Read the scenario. Using the information provided in the references and lesson, arrive with your best possible solution.

  The committee of inquiry

The Committee of Inquiry has just concluded its report on its findings and recommendations in relation to the recent series of major train disruptions in Singapore

  Explain wharton-s story the other two

Give a Works Cited page citation for Edith Wharton's story "The Other Two." This story is printed on pages 691-712 in anthology American Literature Survey.

  Education system

Write a rearch paper on education system

  Write a paragraph or two describing your personality

Write a paragraph or two describing your personality. Think about your quirks, oddities, and habits. How would your friends and family describe you? You do NOT have to diagnose yourself with a disorder, but can if you want.

  State first people in the world to condemn slavery

Why were they still unable to completely destroy it? Among Jacksonian Americans (1815-1865), why did a few people denounce slavery as a sin

  Company laid-off

Your team will act as the leader for the organization. Some members of different functional areas of the company are not in favor of the change and do not believe that Kindle will provide the services and products students and instructors need. In or..

  Examine the ethical and deviant behaviors in policing

Write a 700- to 1,050-word paper in which you analyze the ethical and deviant behaviors in policing. Complete the following in your paper:

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