Question: 36. Use the list class for this exercise. The data consists of objects of the type intEntry: class intEntry { public: intEntry (int v,
36. Use the list class for this exercise. The data consists of objects of the type intEntry: class intEntry { public: intEntry (int v, int c = 1); // initialize the integer value and its count int getValue() const; // return value int getCount() const; // return count void increment (); // increment count friend bool operator < (const intEntry& lhs, const intEntry& rhs); friend bool operators (const intEntry& lhe,const intEntry& rhs); //compare 1hs and rhs using value private: friend ostream& operator < < (ostream& ostr, const intEntry& obj); 1/ output obj in format "value value... value" (count times) int value;: // integer value int count; // number of occurrences of value }; Implement the class using inline code, and place it in the header file "intentry.h." In the main program, input 10 integers, and create an ordered list of intEntry nodes. Do this by modifying the function insertOrder() of Section 6-3 to update an entry when a duplicate is found. Output the resulting list.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
