Course Solutions Uncategorized (Solved) : C Given Class Line Need Define New Class Dashedline Inherits Line Additionally Two Attribu Q32520103 . . . .

(Solved) : C Given Class Line Need Define New Class Dashedline Inherits Line Additionally Two Attribu Q32520103 . . . .

 

(c) You are given a class Line. You need to define a new class DashedLine that inherits from Line and additionally has two attributes int *dashes and int *gaps. i. Write the C++ declaration for DashedLine that clearly shows the inher- itance from Line. Make sure that you explicitly declare the default con- structor, correctly set access modifiers, and follow information hiding pol- icy with respect to the variables int *dashes and int *gaps so that all set/get methods are introduced. [7 marks] ii. In the previous part, assume that Line has a float variable weight defined as a part of the class. What is the access modifier that must be used with weight if we want it to be available to DashedLine but not to other classes that have not inherited Line? [2 marks]

(c)

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post