Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2018 Dublin Ireland September 10 14 2018 Proceedings Part 1 Lnai 11051

Authors: Michele Berlingerio ,Francesco Bonchi ,Thomas Gartner ,Neil Hurley ,Georgiana Ifrim

1st Edition

3030109240, 978-3030109240

More Books

Students also viewed these Databases questions

Question

8. Describe how cultural spaces are formed.

Answered: 1 week ago