Category : abstract

in a finite element code, I’ve a data structure to manipulate the value of a field (coordinates, temperature, …) at a point. This structure is basic and looks like this: class point_data { public: void allocate(int ldim); // allocation of data; const double* get_data() const { return data; } void set_data(const double* ldata); // for ..

Read more

Here is the code for the project, I need to work at implementing inheritance for it. I would like to have some virtual functions and make it a class driven program which uses derived classes and has a base class. The derived clase should inherit the features from the base class and utilize the extra ..

Read more

In my program I’m trying to create abstract class called "DMA", from which "BaseDMA" inherits from it. Then classes "LacksDMA" and "HasDMA" inherits from "BaseDMA". Every class override method readInfo() from "DMA". Here is the code: dma.h #ifndef DMA_H_ #define DMA_H_ #include <iostream> class DMA { protected: char * label; public: DMA(const char * l); ..

Read more

In student.h file class Student { protected: string Name; int Stu_num; public: virtual void print() = 0; // constructor… } class Grad_Student: public Student { private: string Lab; public: void print(); // constructor… } class Undergrad_Student { private: string Major; public: void print(); // constructor… } in student.cpp file bool operator == (const Student& x, ..

Read more