Concepts of an Array

  1. Definitions:
    1. What is an array?
    2. What is an element of an array?
    3. What is an index of an element?
  2. How do you declare an array? (Write Java codes for the questions below.)
    1. Declare an array whose name is odd. It also has 10 integer numbers.
    2. Declare an array whose name is name. It will take five Strings.
    3. Declare an array whose name is price. It will store six floating numbers.
  3. If the size of an array is n, what will the last element's index?
  4. How do you store information in the array? (Write Java codes for the questions below.)
    1. Store first 10 odd numbers in the odd array as the above picture.
    2. Take user's recommending 5 names and store them into the name array as the above picture.
    3. Initialize the first element of the price array as 2.4. Also, install the rest of elements to be twice of the previous element.
  5. Use a "for" loop to print each of the above arrays.