Single-Dimension and Multi-Dimension Arrays
Variables are a critical piece in putting together useful Java programs. You need these constructs to store and access single pieces of data. like a test score or the current temperature outside. However. there are limits to what you can do with a single score or the current temperature. For instance. what if you need to find the average of test scores for a class, for a school. or an entire school district? And. what if you want to find the highest or lowest temperature on a particular date over the past 10 years?
Arrays extend the power of Java programming by providing you with the capability of storing and accessing many pieces of data. With these data constructs. you expand your abilities to solve more complex problems. Using a single-dimensional array in tandem with a looping statement, for example, provides you with the capability of calculating the average test score of that class. and using the nested loop on a multidimensional array lets you find the average for the whole school.
This week. you will extend your Java programming capabilities by exploring and mastering the use of arrays. You will find an existing program and determine how to upgrade that program using arrays and loops, and you will solve a set of exercises on single- and multidimensional arrays to further your Java programming skills.
• Describe why arrays are necessary in programming • Apply arrays in application development