Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

8.8 The Colorado River Drainage Basin covers parts of seven western states. A se

ID: 3812697 • Letter: 8

Question

8.8 The Colorado River Drainage Basin covers parts of seven western states. A series of dams has been constructed on the Colorado River and its tributar- ies to store runoff water and to generate low-cost hydroelectric power (see Figure P8.8). The ability to regulate the flow of water has made the growth of agriculture and population in these arid desert states possible. Even during periods of extended drought, asteady, reliable source of water and electricity has been available to the basin states. Lake Powell is one of these reservoirs. The file lake powell.dat contains data on the water level in the reservoir for the 8 years from 2000 to 2007. These data are shown in Table 8.9. Use the data in the file to answer the following questions: (a) Determine the average elevation of the water level for each year and for the 8-year period over which the data were collected. (b) Determine how many months each year exceed the overall average for the 8-year period. (c) Create a report that lists the month (number) and the year for each of the months that exceed the overall average. For example,J is month 6 (d) Determine the average elevation of the water for each month for the 8-year period

Explanation / Answer

public class waterlevel {
  
   float waterLevle[][] = new float [12][8];
/*   float waterLevle[][] = {[3680.12f, 3668.05f, 3654.25f, 3617.61f, 3594.38f, 3563.41f, 3596.26f, 3601.41f],
                             [3678.48f, 3665.02f, 3651.01f, 3613.00f, 3589.11f, 3560.35f, 3591.94f, 3598.63f],
                             [3677.23f, 3663.35f, 3648.63f, 3608.95f, 3584.49f, 3557.42f, 3589.22f, 3597.85f],
                             [3676.44f, 3662.56f, 3646.79f, 3605.92f, 3583.02f, 3557.52f, 3589.94f, 3599.75f],
                             [3676.76f, 3665.27f, 3644.88f, 3606.11f, 3584.7f, 3571.60f, 3598.27f, 3604.68f],
                             [3682.19f, 3672.19f, 3642.98f, 3615.39f, 3587.01f, 3598.06f, 3609.36f, 3610.94f],
                             [3682.86f, 3671.37f, 3637.53f, 3613.64f, 3583.07f, 3607.73f, 3608.79f, 3609.47f],
                             [3681.12f, 3667.81f, 3630.83f, 3607.32f, 3575.85f, 3604.96f, 3604.93f, 3605.56f],
                             [3678.7f,   3665.45f, 3627.1f, 3604.11f, 3571.07f, 3602.20f, 3602.08f, 3602.27f],
                             [3676.96f, 3663.47f, 3625.59f, 3602.92f, 3570.7f, 3602.31f, 3606.12f, 3601.27f],
                             [3674.93f, 3661.25f, 3623.98f, 3601.24f, 3569.69f, 3602.65f, 3607.46f, 3599.71f],
                             [3671.59f, 3658.07f, 3621.65f, 3598.82f, 3565.73f, 3600.14f, 3604.96f, 3596.79f]};*/

   float avg8YTotal = 0.0f;
  
   public void main(String[] args[]) {
      
       //a
       mean();
      
       //b-qus ans
       find();

       //c-qus ans
      
       lenghtlist();
  
      
       //d-qus ans
       length();
      
   }
  
   public void length () {
      
       float avgMon = 0.0f;
       for(int j=0 ; j<12 ; j++) {
           for (int i=0 ;i < 8; i++) {
               avgMon =avgMon + waterLevle[j][i];
           }
           System.out.println("month "+j+1 +" value "+ avgMon);
           avgMon =0.0f;
       }
   }
  
  
   public void lenghtlist () {
       for (int i=0 ;i < 8; i++) {
           for (int j=0 ; j< 12; j++) {
               if(waterLevle[i][j] > avg8YTotal) {
                   System.out.println((j+1) + ":" + (i+2000));
               }
           }
       }
      
      
   }
  
   public void find() {
       for (int i=0 ;i < 8; i++) {
           System.out.println("year "+i + "exceed months value" + findexceedavg8y(i));
       }
   }
  
  
   public int findexceedavg8y (int index_year) {
       int monthcount=0;
       for(int i=0 ; i<12 ; i++) {
           if(waterLevle[i][index_year] > avg8YTotal) {
               monthcount++;
           }
       }
       return monthcount;
   }
  
  
   public float meanYear(int index_year) {
      
       float avg = 0.0f;
      
       for(int i=0 ; i<12 ; i++) {
           avg= avg + waterLevle[i][index_year];
       }
       return index_year/12.0f;
      
   }
  
   public void mean() {
       //a-qus ans
       float avg8y = 0.0f;
       float avg1y = 0.0f;
       for (int i=0 ;i < 8; i++) {
           avg1y = meanYear(i);
           System.out.println("year "+i + "value" + avg1y);
           avg8y = avg8y + avg1y;
       }
       System.out.println("8 year total avg "+avg8y);
       avg8YTotal = avg8y;
   }

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote