Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

1. Write method print that takes an integer array as an input parameter and prints all the numbers in the array separated by commas. Name your program ArrayTest.java.

2. Write method average that takes an integer array as an input parameter and returns the average of all numbers in the array.  Define this method in ArrayTest.java as well.

3. Write method max that takes an integer array as an input parameter and returns the maximum number in the array. Define this method in ArrayTest.java also.

4. Write a main method. Define several arrays, print the content of the array, the average of the array, and the maximum number in the array. Below is my main method:

      int[] nums = {14, 1, 23};

      System.out.println("My first array is: ");

      print(nums);

      System.out.println("The average of the array is: " + average(nums));

      System.out.println("The maximum number in the array is: " + max(nums));

      System.out.println("");

      int[] nums2 = {11, 26, 4, 2};

      System.out.println("My second array is: ");

      print(nums2);

      System.out.println("The average of the array is: " + average(nums2));

      System.out.println("The maximum number in the array is: " + max(nums2));

5. Create zip file that contains your Java programs. Include a screenshot of each program execution. You can either paste the screenshot into a Word document or simply paste it into the Comments field when submitting your homework. A sample screenshot of running my programs is attached below:

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92710530
  • Price:- $25

Priced at Now at $25, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Please discuss the design principles that guide the authors

Please discuss the design principles that guide the authors of instruction sets in making the right balance. Provide examples of application of each of the three design principles while designing instruction sets.

Answer the following question what is the subnet mask of a

Answer the following Question : What is the subnet mask of a prefix of 26? How you obtain that subnet mask? Describe a prefix length and its used to identify networks. Descibe the ISP Tiers, classification and purposes.

A small library keeps a roster of who will be at the desk

A small library keeps a roster of who will be at the desk each day. They have a database table as shown below. Week Start___Mon___Tue____Wed_____Thur____Fri 17/10/2011 -- Jane -- Sue -- George -- Sue -- Jane 24/10/2011 - ...

What are the minimum and maximum values in decimal if an

What are the minimum and maximum values (in decimal) if an 8-bit binary number is given unsigned and two's complement formats?

Runtime vs realtime considerations1 research the concept of

Runtime vs. Realtime Considerations 1. Research the concept of compilation with regards to code. 2. Is there a difference in how scripts are compiled vs. how programs are compiled? 3. What is the difference between compi ...

Service set identifier ssid also known as the wireless

Service Set Identifier (SSID), also known as the wireless network name, identifies the wireless network. An SSID is configured on the wireless AP (on the access point for the infrastructure mode) or on an initial wireles ...

We can represent numbers in different bases think of how

We can represent numbers in different bases. Think of how you could represent the number 5 in base 2. Essentially, how can you break the number 5 into powers of 2. It contains one 4 and one 1. In base 2, your digit overf ...

Scheme questionthe following program can be used to

Scheme Question The following program can be used to determine if a given interpreter is using applicative-order evaluations or normal-order evaluation: (define (p)(p)) (define (test x y) (if (= x 0) 0 y)) (test 0 (p)) ( ...

Stereotypes are useful toolsthey provide a shorthand way of

Stereotypes are useful tools. They provide a shorthand way of dealing with differences and allowing us to categorize how people think about things and interact with our world. Explain the positive effects of stereotypes ...

Suppose that we reconsider our student example and the only

Suppose that we reconsider our STUDENT example and the only attributes of STUDENT are student number and name. Let us suppose that we have another entity called HIGH SCHOOL, that is going to be the high school from which ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As