hello,please I have a project to do in java concerning arrays. If
somebody knows the answer,please send it to my email adress
(ziyade4@hotmail.com),i'll be thankfull.
this is the exercice.
// Topographical maps are easily represented with two-dimensional
arrays of integer or real valued
heights. However, the bird's eye view they provide is sometimes
difficult to appreciate after a day of
lugging a 70-pound backpack.
Consider a two-dimensional array variable storing real numbers and
representing heights of a
topographical map.
Write a program that locates peaks. We define a peak as any point that
is higher than its eight
neighbors.
Write a program that locates valleys. A valley is any series of three
points along a row or column that
are lower than their twelve neighbors. (Can you deal with longer
valleys as well?)
1. Define a two-dimensional array type for holding real numbers and
having a size of maxrow times
maxcol;
2. Declare a Boolean method that tests if a point of this map
represents a peak;
3. From the main program locate all peaks and output their positions
and heights;