Question: floatarray.cpp: // This program reads floating point data from a data file and places those // values into the private data member called values (a

 floatarray.cpp: // This program reads floating point data from a data

file and places those // values into the private data member called

floatarray.cpp:

// This program reads floating point data from a data file and places those // values into the private data member called values (a floating point array) // of the FloatList class. Those values are then printed to the screen. // The input is done by a member function called GetList. The output // is done by a member function called PrintList. The amount of data read in // is stored in the private data member called length. The member function // GetList is called first so that length can be initialized to zero. // PLACE YOUR NAME HERE #include  #include  #include  using namespace std; const int MAX_LENGTH = 50; // MAX_LENGTH contains the maximum length of our list class FloatList // Declares a class that contains an array of // floating point numbers { public: void getList(ifstream&); // Member function that gets data from a file void printList() const; // Member function that prints data from that // file to the screen. FloatList(); // constructor that sets length to 0. ~FloatList(); // destructor private: int length; // Holds the number of elements in the array float values[MAX_LENGTH]; // The array of values }; int main() { ifstream tempData; // Defines a data file // Fill in the code to define an object called list of the class FloatList cout  

temperatures.txt:

78.9 87.4 60.8 70.4 75.6

Please just follow the introduction on exercise(do not modfiy to the other form)

This is important so that I can learn some thing from your anwser. Thx

Retrieve program floatarray.cpp and temperatures.txt from the Lab 13 folder The code is as follows

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!