Menu

[Solved]Design Class Array Floating Point Numbers Constructor Accept Integer Argument Dynamically Q37180949

Design a class that has an array of floating point numbers. Theconstructor should accept an integer argument and dynamicallyallocate the array to hold that many numbers. The destructor shouldfree the memory held by the array. In addition there should bemember functions that perform the following operations:

Store a number in any element of the array

Retrieve a number from any element of the array

Return the highest value stored

Return the lowest value stored

Return the average value of the numbers stored

Sample output:

How many numbers do you want to store? 5

Enter the 5 numbers:

        Number 0: 56

        Number 1: 13

        Number 2: 99

        Number 3: 47

        Number 4: 23

Here are the values you entered:

        Number 0: 56

        Number 1: 13

        Number 2: 99

        Number 3: 47

        Number 4: 23

The average of those values is 47.6

The highest number is 99

The lowest number is 13

Which cell do you want to retrieve the value from:

Cell number: 2

Cell number 2 contains: 99

Which cell do you want to modify the value:

Cell number: 3

Cell number 3 new contents will be: 130

Which cell do you want to retrieve the value from:

Cell number: 3

Cell number 3 contains: 130

10:07 < Notes Need this done in C++10:07 < Notes Need this done in C++ Show transcribed image text 10:07

Expert Answer


Answer to Design a class that has an array of floating point numbers. The constructor should accept an integer argument and dynami… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *