Ask Question
30 November, 07:17

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. 30 November, 10:50
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers