M1 Lab Assignment 2: Working with Arrays (Week 3)
These chapter exercises will reinforce Java Programming concepts/skills on working with Arrays.
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
- Create an Array of 10 random whole numbers between 1-100.
- You either select them or use the random function for bonus points).
- Create a method to find the average of the 10 numbers.
- Display the average to the screen.
- Create a method to find the min and the max.
- Display the min and max to the screen.
- Sort the Array from low to high and display the the numbers on the screen.
- 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
- Create a multi dimension array that consists of 2 rows and 5 columns.
- Load 10 random whole numbers between 1-100 into the multi dimension array.
- Create a method to find the sum of the numbers in the array.
- Find the smallest number in the array.
- 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.
General Instructions for Lab Assignments
Your lab assignment needs to be presented in a professional manner include your name, course, the title of assignment, professor’s name, date, task, and include a list of sources used, if applicable. The Research and Library Tips page will help you properly cite sources using a consistent format, so that your academic integrity is not called into question. The final lab assignment must include answers that are clear and any rationale that helps to detail how you derived your answers. The evaluation of your submission will consider grasp of readings, depth of analysis, content organization, clarity of writing and vocabulary use. Be sure to submit your lab assignment by the close of this module, I would prefer that it is attached as a .doc or .rtf formatted document.