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

  State how high-performance workplaces

Discuss how high-performance workplaces and organizations differ from traditional organizations regarding operational effectiveness, workplace stress

  Family

Why is it important to have a research question when writing a research paper

  Explain the perception of the accuracy

Describe your perception of the accuracy of these measures. Discuss the implications of the scores for your effectiveness as a leader. Give specific examples to support your ideas of effective leadership.

  Normal brain development

The causes of normal brain development could be difficult to judge if there was unclear definitions and information. According to Reiss et al (1996), the researchers described, "because of the scarcity of normal quantitative paediatricneuroimaging da..

  Ronald mcdonald nor myself

Are you tall as him?b) Neither Ronald McDonald nor myslef want to be on the team. c) Did he leave any word for John and she?

  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.

  Online versus brick-and-mortar shopping

Online versus brick-and-mortar shopping, What two objects, people, subjects, or concepts are you going to compare and contrast?

  Black hole

The Black Hole video is about ethics. Ethics can have a big influence on decision making in the workplace. Ethical behavior in the workplace is behavior that is accepted as morally "right," rather than "wrong." When the employee realized that the pap..

  The role of the supernatura

The Role of the Supernatural: Both works that we read have elements that take us beyond realism

  Define a chart/matrix that identifies the six facets

Create a chart/matrix that identifies and describes the Six Facets of Understanding. Brainstorm at least three activities for each facet. Activities must be appropriate for grades 7-9.

  Words essay about othello by william shakespeare

minimum 1000 words essay about Othello by william shakespeare !! doublespace 12 size!!

  Gilgamesh and the odyssey

Several body paragraphs providing a thorough discussion of ancient heroism, supported with examples from Gilgamesh and The Odyssey.

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