Arrays Exercises
Arrays Exercises
Arrays: Exercises
1.- Write Java statements to accomplish each of the
following tasks:
a) Display the value of element 6 of array f.
b) Initialize each of the five elements of one-
dimensional integer array g to 8.
c) Total the 100 elements of floating-point array c.
d) Copy 11-element array a into the first portion of
array b, which contains 34 elements.
e) Determine and display the smallest and largest
values contained in 99-element floating point array w.
a) $200–299
b) $300–399
c) $400–499
d) $500–599
e) $600–699
f) $700–799
g) $800–899
h) $900–999
i) $1000 and over
Summarize the results in tabular format.
4.- (Duplicate Elimination) Use a one-dimensional array to
solve the following problem: Write an application that
inputs five numbers, each between 10 and 100, inclusive. As
each number is read, display it only if it is not a
duplicate of a number already read. Provide for the “worst
case,” in which all five numbers are different. Use the
smallest possible array to solve this problem. Display the
complete set of unique values input after the user enters
each new value.