Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 marks is not full.
  3. A method named output that output:Average of values in the list.
  4. Number of values in the array below average.
  5. Number of values in the array above average.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions