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

  Identify ports with the unique neighbor reached directly

Consider the arrangement of learning bridges shown in Figure 3.38. Assuming all are initially empty, give the forwarding tables for each of the bridges B1-B4 after the following transmissions:

  Mining association rules with weka

In Module 3, you installed Weka and used Weka to classify some data. This Critical Thinking assignment will require you to use Weka to mine association rules.  We will do this using the apriori algorithm.  Your assignment is to open the data file ..

  How to use system tools to identify problems

How can you use system tools, such as the Task Manager, to help identify and troubleshoot these problems? Report your findings in a one page paper.

  Operating systems for mainframe computers

1. What are the main differences between operating systems for mainframe computers and personal computers? 2. Describe in detail the difference between the client-server and peer-to-peer models of distributed systems.

  Describe the use of the controltovalidate

Discuss authorization and authentication and explain forms-based-authentication. Describe the use of the ControlToValidate, Validation expression, ErrorMessage, and Enabled properties of a validation control.

  Describe of what the computer considers true or false

For your initial post, provide your own description of what the computer considers "TRUE" and what the computer considers "FALSE." Then, provide at least two code examples (original examples) that would return TRUE

  Design and test using logic works

Design and test using Logic Works a dual-output function to implement a full-adder in Sum-of-Products form. Show the transistor count on your schematic.

  What is intellectual property

QUESTION 1: What is intellectual property? Why is it a valuable asset for the owner? How are intellectual property rights acknowledged and protected?

  Relationships among software engineering

1. Describe the relationships among software engineering process methods and tools? 2. What are the primary advantages of the component based process model for Software engineering?

  Merged and centered across all columns used

Your name should list in cell A1 in an enlarged font size with a new font name merged and centered across all columns used. Display in a labelled cell the current GPA. Include column headings for the course name, course credit ho..

  What factors are involved in selecting architecture

Under what architecture would you classify technologies such as virtualization, cloud computing, and Web-based applications? Last, what factors are involved in selecting the architecture that is right for your organization?

  Improve the maneuverability of military fighter aircraft

By how much is the thrust (force along the centerline of the aircraft) reduced for the case indicated compared to normal flight when the exhaust is parallel to the centerline?

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