Design a class that has an array of floating-point numbers

Assignment Help Data Structure & Algorithms
Reference no: EM13708032

Question: 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 destructor should free the memory held by the array. Also, there would be member functions to perform the given 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 numbers stored in the array

Prepare a program that shows the use of the class, adding all of its member functions.

Reference no: EM13708032

Questions Cloud

Write a program that will read input and write it back out : Write a program that will read input, and write it back out, character by character. Propend each line of input with a line number.
Program to implement a stack and a queue : Write a C/C++ program to implement a stack and a queue as applications of LL.
Find functions as well as the array addressing methods : Find functions as well as the array addressing methods, and the functions, operators, and control structures to create your own version of the max for a row array as input. This function will return two values:
Write a class named retailitem : Write a class named RetailItem that holds data about an item in a retail store. The class should have the given member variables:
Design a class that has an array of floating-point numbers : 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.
Displays the stored array values on the screen : Displays the stored array values on the screen using WriteInt - Prompts the user for integer input a dozen times
Find an example of an actual data warehouse : Find an example of an actual data warehouse. For this example, describe the content, purpose, user access methods, and sources of data
Expand the example to cover the loan officers : Expand the example to cover the loan officers. They do have people waiting for them acting like a queue.
Write a program to display the total salary for assistant : Write a program to display the total salary for assistant professors, associate professors, full professors, and all faculties, respectively, and show the average salary for assistant professors, associate professors, full professors, and all facu..

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Divide-and-conquer two-dimensional closest-pair algorithm

consider the version of the divide-and-conquer two-dimensional closest-pair algorithm in which, instead of presorting input set P, we simply sort each of the two sets Pl and Pr in nondecreasing order of their y coordinates on each recursive call

  Evaluate the time complexity of algorithm

You will be designing a non-member function that accepts as its argument one dynamic bag object (header file found in figure 4.9).  This function will return a reference to a new dynamic bag object.

  Ambiguity in proposed algorithm-in representation algorithm

Describe distinction between the ambiguity in proposed algorithm and ambiguity in representation of the algorithm.

  What is the largest x such that the protocol performs x-bit

What is the largest x such that the protocol performs x-bit correction and what algorithm would you use to perform this correction? Give me the pseudo-code (or a sensible explanation)

  Write a program that uses the bubble sort algorithm

You need to write a program that uses the bubble sort algorithm and load data into an array and then sort it into ascending order. It should output the first five and last five numbers from the file both before and after the sort.

  Kind of switching to configure switch to use

Your network's traffic load is very high all times, day and night. What kind of switching do you configure switch to use?

  Algorithm-find schedule to obtain maximum amount of profit

Give an algorithm to find schedule which obtains maximum amount of profit, assuming that all processing times are integers between 1 and n.

  Organizing the data in ms excel

Many of your family members have discovered that you are using Excel to organize the information for the high school reunion. Your Uncle Larry wants to make an inventory of the over 800 video games that he collects.

  Create algorithm to accept current salary

Create the algorithm which will prompt for and accept current salary for each of faculty members, then compute and show their individual pay increases.

  Universalist rationality theory

Universalist rationality theory supposes that actors within an institution are rational. They function with their own material interests in mind, maximizing efficiency and resources.

  Question about data network

The Minnesota Computer Consulting Group is a fifty person consulting services practice focusing on telecommunications and systems administration that includes Minnesota offices in Minneapolis, St. Paul, and Rochester.

  Creating a method find ranks in java

Create a method findRanks in Java that accepts an unsorted array of integers vals, and starting and ending rank start and end, numbering ranks from 0,

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