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++

Need to make an abstract data type class that creates a one-dimensional

array of different data types ( an int, double, char, bool, string

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

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!