Array of floating-point numbers

Assignment Help Basic Computer Science
Reference no: EM131502586

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

Reference no: EM131502586

Questions Cloud

Steps in eliciting requirements : Select one of the steps in eliciting requirements and briefly explain what the step accomplishes and why it is important.
Discuss why projects often fail : Discuss why projects often fail. Give a specific example which may lead to project failure.
Important part of the business process : Developing and keeping customers is an important part of the business process. Customers mean business. If we lose customers, we lose business.
Describe how you would apply inferential statistics : Write a 2 page paper describing how you would apply inferential statistics as part of your data analysis for the research and design methods you determined.
Array of floating-point numbers : Number Array Class Design a class that has an array of floating-point numbers. The constructor should accept an integer argument.
Effective deterrent to hacking in today : Are good passwords an effective deterrent to hacking in today's environment? If they are not, an effective deterrent, what other safeguards would you implement?
Explain organizational culture as it relates to supervision : You are the Chief of Police of Riverside. Analyze organizational culture as it relates to the supervision of criminal justice entities.
Define the sdlc model and methodology : The main goal for the system is to detect adversaries in a company network.
Discuss what factor were essential for success of technology : Identify a technology or application that had a successful product. Discuss what factors were essential for success or failure of the technology or application.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Displays something different on the screen

1. Give an example of a one-line script that does display something on the screen when the script is executed, but displays something different on the screen when that line is entered into the interactive shell. (using Python)

  Which of the following can increase reliability

Which of the following can increase reliability considerably in an Ethernet LAN

  Current household budget

Explain how your own current household budget, tastes and preferences, and future expectations determine how much of each of these products you purchase in a year. Describe the benefits (utility) you get from each product and service.

  What is the probability

For instance, if a blue ball is picked then it is replaced by a red ball and vice-versa. The process is repeated ten times and then a ball is picked from the box. What is the probability that this ball is red?

  Questions related to mcqs

The quality of a language that allows a programmer to express a computation clearly, correctly, concisely, and quickly is called _____.

  How much ram is installed on your computer?

How much RAM is installed on your computer?

  History of the twenty-first century

Friedman, T. L. (2005). The World is Flat: A Brief History of the Twenty-first Century. New York: Farrar, Straus and Gioux, PAGES 308-373, 477-530.

  Identify any potential problems with the model

Plot the Pearson residuals for the groups against the interval centers (available in the pear.res and centers components, respectively, of the list returned by the function). Use this plot and the residual plots from part (c) to explain the result..

  General purpose registers

Construct a memory map for both ATMega328 and the Intel Xeon (E7 v3 family).  Include hexadecimal addresses to denote memory locations and clearly indicate the name for each section of memory (i.e. General Purpose Registers, Special Purpose Regist..

  Industry and perspectives of christian worldview

In an essay of 750-1,000 words, explore ethical decision making and arrive at conclusions relevant to your industry and perspectives of Christian worldview.

  How does a category differ from a regular shared subclass

How does a category differ from a regular shared subclass?

  Write a program that draws such a target

Each ring has the same "width," which is the same as the radius of the yellow circle. Write a program that draws such a target. Hint: Objects drawn later will appear on top of objects drawn earlier.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd