using System; public static class Lab8 {    public static void Main()    {       int[] compStats = new int[25];       int n = 0, large, small;       double avg = 0;       // Input values into the array       InpArray(compStats, ref n);       // Find the average of the elements in the array       // *** Insert the code for the call to the FindAverage method       // Find the largest element in the array       // *** Insert the code for the call to the FindLarge method       // Find the largest element in the array       // *** Insert the code of the call to the FindSmall method       // Print out the results       Console.WriteLine("\nThe Average of the array is {0:F}", avg);       // *** Insert the code to print out the largest and smallest values       // Pause until user is done       Console.ReadLine();    }    // Method:       InpArray    // Description:  Input values into an array.    // Parameters:   arrValues: the array to fill.    //               num: number of elements in the array.    // Returns:      void    public static void InpArray(int[] arrValues, ref int num)    {       // input the number of data values to put in the array       do       {           Console.Write("Enter the number of elements (<= 25) => ");           num = Convert.ToInt32(Console.ReadLine());       } while (num < 0 || num > 25);       // loop to enter the values       for (int i = 0; i < num; ++i)       {           Console.Write("Enter the Element {0} => ", i);           arrValues[i] = Convert.ToInt32(Console.ReadLine());       }    }    // Method:       FindAverage    // Description:  Computes the average of the elements in the array.    // Parameters:   arrVals: array to be processed    //               num: number of elements in the array.    // Returns:      the average of the elements in the array    public static double FindAverage(int[] arrVals, int num)    {       // *** Insert the details of the FindAverage Method    }    // Method:       FindLarge    // Description:  Determines the largest element in the array.    // Parameters:   arrVals: array to be processed    //               num: number of elements in the array.    // Returns:      the largest element in the array    public static int FindLarge(int[] arrVals, int num)    {       // *** Insert the details of the FindLarge Method       //**Do not use built in C# array functions (like Sort or Max) to do this, it should be done using iteration. */    }    // Method:       FindSmall    // Description:  Determines the smallest element in the array.    // Parameters:   arrVals: array to be processed    //               num: number of elements in the array.    // Returns:      the smallest element in the array    public static int FindSmall(int[] arrVals, int num)    {       // *** Insert the details of the FindSmall Method         //**Do not use built in C# array functions (like Sort or Max) to do this, it should be done using iteration. */    } }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

using System;
public static class Lab8
{
   public static void Main()
   {
      int[] compStats = new int[25];
      int n = 0, large, small;
      double avg = 0;

      // Input values into the array
      InpArray(compStats, ref n);

      // Find the average of the elements in the array
      // *** Insert the code for the call to the FindAverage method

      // Find the largest element in the array
      // *** Insert the code for the call to the FindLarge method

      // Find the largest element in the array
      // *** Insert the code of the call to the FindSmall method

      // Print out the results
      Console.WriteLine("\nThe Average of the array is {0:F}", avg);
      // *** Insert the code to print out the largest and smallest values

      // Pause until user is done
      Console.ReadLine();
   }

   // Method:       InpArray
   // Description:  Input values into an array.
   // Parameters:   arrValues: the array to fill.
   //               num: number of elements in the array.
   // Returns:      void
   public static void InpArray(int[] arrValues, ref int num)
   {
      // input the number of data values to put in the array
      do
      {
          Console.Write("Enter the number of elements (<= 25) => ");
          num = Convert.ToInt32(Console.ReadLine());
      } while (num < 0 || num > 25);

      // loop to enter the values
      for (int i = 0; i < num; ++i)
      {
          Console.Write("Enter the Element {0} => ", i);
          arrValues[i] = Convert.ToInt32(Console.ReadLine());
      }
   }

   // Method:       FindAverage
   // Description:  Computes the average of the elements in the array.
   // Parameters:   arrVals: array to be processed
   //               num: number of elements in the array.
   // Returns:      the average of the elements in the array
   public static double FindAverage(int[] arrVals, int num)
   {
      // *** Insert the details of the FindAverage Method
   }

   // Method:       FindLarge
   // Description:  Determines the largest element in the array.
   // Parameters:   arrVals: array to be processed
   //               num: number of elements in the array.
   // Returns:      the largest element in the array
   public static int FindLarge(int[] arrVals, int num)
   {
      // *** Insert the details of the FindLarge Method
      //**Do not use built in C# array functions (like Sort or Max) to do this, it should be done using iteration. */
   }

   // Method:       FindSmall
   // Description:  Determines the smallest element in the array.
   // Parameters:   arrVals: array to be processed
   //               num: number of elements in the array.
   // Returns:      the smallest element in the array
   public static int FindSmall(int[] arrVals, int num)
   {
      // *** Insert the details of the FindSmall Method
        //**Do not use built in C# array functions (like Sort or Max) to do this, it should be done using iteration. */
   }
}

Replace the lines marked with // *** with the appropriate C# code (may require more than one line of code to complete the missing
parts).
b. Once you are comfortable that your program works correctly, test it with the following 3 sets of inputs and for each output, include a screen
capture for each in your Google Doc for this lab. (use a screen capture tool such as pressing cmd + Shift + 4, then drawing a
rectangle around the area you wish to capture).
Transcribed Image Text:Replace the lines marked with // *** with the appropriate C# code (may require more than one line of code to complete the missing parts). b. Once you are comfortable that your program works correctly, test it with the following 3 sets of inputs and for each output, include a screen capture for each in your Google Doc for this lab. (use a screen capture tool such as pressing cmd + Shift + 4, then drawing a rectangle around the area you wish to capture).
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education