# m1 lab assignment 2 working with arrays week 3

## M1 Lab Assignment 2: Working with Arrays (Week 3)

These chapter exercises will reinforce Java Programming concepts/skills on working with Arrays.

### Instructions

In this assignment you demonstrate your understanding of working with Arrays in JAVA by completing the tasks below and answering the questions.

#### Part 1: One Dimensional Arrays

1. Create an Array of 10 random whole numbers between 1-100.
• You either select them or use the random function for bonus points).
2. Create a method to find the average of the 10 numbers.
• Display the average to the screen.
3. Create a method to find the min and the max.
• Display the min and max to the screen.
4. Sort the Array from low to high and display the the numbers on the screen.
5. Reverse the Array sort from high to low and display the numbers on the screen.

Note: Steps 2-5 Can be completed in any order you feel is best suited to accomplish the task

#### Part 2: Multi Dimension Arrays

1. Create a multi dimension array that consists of 2 rows and 5 columns.
2. Load 10 random whole numbers between 1-100 into the multi dimension array.
3. Create a method to find the sum of the numbers in the array.
4. Find the smallest number in the array.
5. Search your an array for any odd number and display them on the screen along with their position in the array.

Note: Steps 3-5 Can be completed in any order you feel is best suited to accomplish the task

In completing this assignment answer the following questions and submit a document along with your source codecontaining the following elements:

• Where you able to accomplish each of the above tasks?
• If no, which one(s) did you struggle with and what did you do to seek out help?
• Which of the above tasks did you find most challenging?
• Which algorithms did you use from chapter 2’s reading?
• Submit a screen shot of each of your programs:
• Source code
• Running showing the results to each of the tasks.

Be sure to submit both your document and source code for this assignment.