Ask Question
27 November, 07:26

Given a one-dimensional array named yearlySalesTotals that contains decimal values, code the first line of a for statement that declares an index, a Boolean expression for ending the for loop, and an increment expression that lets you use the index to refer to each element in the array.

+3
Answers (1)
  1. 27 November, 11:05
    0
    for (int i = 0; i
    Explanation:

    The for statement in has the syntax as given above, it has an int variable indicating the starting index, then a boolen condition ensuring that you don't get out of the array bounds, and an increment operator.

    See below a complete program in java that will output all elements of the array assuming the array yearlySalesTotals contains only ten elements and all indexes has been assigned values.

    public class ANot {

    public static void main (String[] args) {

    double []yearlySalesTotals = new double[10];

    for (int i = 0; i
    System. out. println (yearlySalesTotals[i]);

    }

    }

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Given a one-dimensional array named yearlySalesTotals that contains decimal values, code the first line of a for statement that declares an ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers