Ask Question

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.

+1
Answers (1)
  1. 11 January, 01:52
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers