Question: * This are the 3 c++ files that have to be implemented, two files are cpp and one header file/ -------------------------------------------------------------------------------------------------------------------------------------------------- #include // Provides copy

* This are the 3 c++ files that have to be implemented, two files are cpp and one header file/
--------------------------------------------------------------------------------------------------------------------------------------------------
#include// Provides copy function #include // Provides assert function #include "sequence.h" using namespace std; namespace main_containers { const sequence::size_type sequence::CAPACITY; void sequence::remove_current() { size_type i; if (!is_item()) current_index = 0; for (i = current_index; i ------------------------------------------------------------------------------------------------------------------------------------------
#include#include #include "sequence.cpp" using namespace std; using namespace main_containers; int main ( int argc, char *argv[] ) { // the sequence for the HW is 5, 2, 200, -3.0, 45, -55.5 // I have started the testing specificed in the HW for you. sequence numbers; numbers.start(); numbers.insert(5); // Continue your testing here. } -----------------------------------------------------------------------------------------------------------------------------
// FILE: bag1.h #ifndef MAIN_CONTAINERS_H #define MAIN_CONTAINERS_H #includeFinish the Implementation of the Sequence class. by running the following set of commands: 1.Create sequence called seq; 2.Insert numbers 5, 2, 200, -3.0, 45, -55.5 3.Print out sequence 4.Remove the -3.0 5.Print out sequence// Provides size_t #include using namespace std; namespace main_containers { class sequence { public: // TYPEDEFS and MEMBER CONSTANTS typedef double value_type; typedef std::size_t size_type; static const size_type CAPACITY = 30; // CONSTRUCTOR sequence( ) {} // MODIFICATION MEMBER FUNCTIONS void start(); void advance(); void insert(const value_type& entry); void attach(const value_type& entry); void remove_current(); // CONSTANT MEMBER FUNCTIONS size_type size( ) const { return used; } bool is_item() const; value_type current() const; private: value_type data[CAPACITY]; // The array to store items size_type used; // How much of array is used size_type current_index; // Index of current item }; // NONMEMBER FUNCTIONS for the sequence class } #endif
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
