Question: Write the definition of a class named listClass that includes the following private members: list: an array of type double. count: an integer to represent

Write the definition of a class named listClass that includes the following private members:

  • list: an array of type double.
  • count: an integer to represent the number of elements in list array

Additionally, the class should include the following public methods:

  1. A default constructor to initialize count to zero and create list as an array of size 30.
  2. A method named addValue, that takes a parameter (m) of type double. The method should add the value (m) to the end of the array and increment count if the array is not full.
  3. A method named output that output:
    1. Average of values in list.
    2. Number of values in the array below average.
    3. Number of values in the array above average.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!