7) Write an implementation of this class using the C++ language. (i.e. implementation of the abstract class and all of its functions definition)
a. Class label: MyClass
b. Private members: int y, int array[10]
c. Public members: void sety(int a);
int gety();
void set_array(int a[], int size);
MyClass();
MyClass(int a, int a[], int size);

Recommended Answers

All 2 Replies

What exactly do you want? If you want the stated to be written so you can complete your homework without effort, I don't think that will happen. To begin with you can look at class declarations, learn about Object oriented programming.

class MyClass { }
will create a class with the name MyClass. Each class can have many fields which are decleared public/private/protected. In most cases you'll set them as private so its a good start. Each field has a type such as bool (boolean), int(integer), String etc. When you declear fields you choose their scope and give the variable a name such as int MyInt reserves a space in memory for an integer called MyInt. You can set it to any real value using = so MyInt = 0;
Each class has a number of methods. Such as for example private int getMyInt() which by declaration returns an int ( declared in the method body). If you want a method to not return anything you set it as void. Now, if we want our method to return the value of MyInt then in the method body we have return MyInt. I think this is a good start to begin with

Am finding difficult in receiving signals to the monitor, though the Motherbody, VGA cable are ok

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.