Question: Need to make an abstract data type class that creates a one-dimensional array of different data types ( an int, double, char, bool, string )
Need to make an abstract data type class that creates a one-dimensional array of different data types ( an int, double, char, bool, string )
C++


I dont want someone to write the code for me rather I just need help getting started in the right place my objective is to write out an implementation for the 2 classes to make that 1 demensional array with the different data types.
im still pretty new to C++ so a topic like this was very challenging but I have the concept in mind already.
#ifndef GENERICVALUE_H #define GENERICVALUE_H #include #include class GenericValue private: std::string value; std::string type; bool isInteger (const std::string &) const; bool isDouble(std::string &); bool ischar(const std::string &) const; bool isString(const std::string &) const; bool isBoolean(const std::string &) const; public: void read(const std::string &); bool operator != (const GenericValue & const; void print() const; #endif This class will use the Generic Value class to implement an array-based list. #ifndef GENERICVALUEARRAY_H #define GENERICVALUEARRAY_H #include #include #include "GenericValue.h" class GenericvalueArray private: GenericValue *values=nullptr; int count; int size; void swap(int, int); public: GenericvalueArray(int); GenericvalueArray(const GenericvalueArray&); const GenericValueArray & operator = (const GenericValueArray&); bool operator == (const GenericvalueArray &) const; bool push_back(const Genericvalue &); bool pop_back(); void reverse(); bool removeFrom(int); void print) const; GenericvalueArray(); }; #endif #ifndef GENERICVALUE_H #define GENERICVALUE_H #include #include class GenericValue private: std::string value; std::string type; bool isInteger (const std::string &) const; bool isDouble(std::string &); bool ischar(const std::string &) const; bool isString(const std::string &) const; bool isBoolean(const std::string &) const; public: void read(const std::string &); bool operator != (const GenericValue & const; void print() const; #endif This class will use the Generic Value class to implement an array-based list. #ifndef GENERICVALUEARRAY_H #define GENERICVALUEARRAY_H #include #include #include "GenericValue.h" class GenericvalueArray private: GenericValue *values=nullptr; int count; int size; void swap(int, int); public: GenericvalueArray(int); GenericvalueArray(const GenericvalueArray&); const GenericValueArray & operator = (const GenericValueArray&); bool operator == (const GenericvalueArray &) const; bool push_back(const Genericvalue &); bool pop_back(); void reverse(); bool removeFrom(int); void print) const; GenericvalueArray(); }; #endif