Question: In Figure 9.7s MovingAverage program, suppose you want to shift in the other direction. How would you write the inner for loop header, and how
In Figure 9.7’s MovingAverage program, suppose you want to shift in the other direction. How would you write the inner for loop header, and how would you write the array assignment statement in the inner for loop?
Figure 9.7
/********************* *Moving Average.java * Dean & Dean * import java.util.Scanner; public class MovingAverage { ******************* * This program contains an operation that shifts each array * element to the next lower element and loads a new input. * into the final element. *******: public static void main (String[] args) { Scanner stdIn = new Scanner (System.in); int[] days (9400, 9500, 9600, 97003; // rising market double sum; int samples; // shift down and sum sum - 0.0; for (int d=0; d
Step by Step Solution
3.42 Rating (149 Votes )
There are 3 Steps involved in it
In the MovingAverage program to sh... View full answer
Get step-by-step solutions from verified subject matter experts

