Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Number Array Class Design a class that has an array of floating-point numbers. The constructor should accept an integer argument and dynamically allocate the array to hold that many numbers. The private data members of the class should include the integer argument in a variable to hold the size of the array and a pointer to float type to hold the address of the first element in the array . The destructor should free the memory held by the array . In addition, there should be member functions to 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 in the array
  • Return the lowest value stored in the array
  • Return the average of all the numbers stored in the array Demonstrate the Class in a Program

SAMPLE RUN : Interactive Session: Creating a Float Class Array Object with a size of 5.Using setI function with calls (0,1.4),(1,2.3),(2,3.13),(3,6.66),(4,7.711) to load array. Using getI with all legitmate index values to print array.

The value of fArray1[0]= 1.4

The value of fArray1[1]= 2.3

The value of fArray1[2]= 3.13

The value of fArray1[3]= 6.66

The value of fArray1[4]= 7.711

Calling getHi returns highest value in array as: 7.711

Calling getLow returns lowest value in array as: 1.4

Calling getAvg returns the average of the array as: 4.2402

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92311315
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Need help with the following 2 problems1 they offer you a

Need help with the following 2 problems: 1. They offer you a promissory note with a four-year maturity, which will generate $ 3,000 at the end of each of the four years. Its price is $ 10,200. What is the implicit annual ...

Question suppose we have a message m 0101011010100001 to

Question : Suppose we have a message m = 0101011010100001 to be transmitted across a network and to protect it from errors, we use the CRC generator polynomial P(x) = x 7 +x 6 +x 2 +x. Answer the following: (a) What is t ...

Questionbased on the option chain below consider an

Question: Based on the option chain below : Consider an asymmetric butterfly constructed using the given put options with the low strike at 58, the peak at 60 and the high strike at 64, for one unit of the underlying ass ...

Question how to run the test in the bluehill programwhat

Question : How to run the test in the Bluehill program? What are the typical items (input or control) you should include in the test method in the Bluehill program? How do you set up a test method in the Bluehill program ...

Reading the biographybook where the body meets memory by

Reading the Biography Book : "Where the Body Meets Memory" by David Mura Questions: The internment camps were a very painful experience for Japanese Americans. They were also a very important and awkward chapter in Ameri ...

Question in relational algebra is the set difference

Question : In relational algebra: is the set difference commutative or not and Why? What is the difference between multivalued and composite attribute? Explain with Example.

Without doing any math or drawing a graph which is bigger

Without doing any math, or drawing a graph, which is bigger, compensating variation or equivalent variation for a tax? Consider an individual with Cobb-Douglas preferences over some good and all other goods. In what sens ...

A financial analyst examined the possible returns from

A financial analyst examined the possible returns from several financial investments. When the performance of these investments was later examined, it turned out that 25% performed much better than the market average, 25 ...

In linux what synchronization methods they use within the

In Linux what synchronization methods they use within the kernel, please dig into your findings for Linux.

Secret channels a company uses public internet to carry its

Secret Channels A company uses public Internet to carry its phone service. The voice data will be encrypted before sending to Internet. The encryption algorithm is as follows: For each four-digit decimal integer, (1) Add ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As