I have a problem with this exercise: Define a class representing the circle. A constant defined class that contains the value of pi, and a variable defined when reading only the color of the circle. Possible colors are listed. Variables define a specific class to hold the radius of a circle AND functions that calculate the perimeter and area of โโan object. This is what I did:
class Circle { public const double PI = 3.14; public readonly enum color { Black, Yellow, Blue, Green }; int radius; public Circle(string Color,int radius) { this.radius = radius; } }
I do not know how I can put an enumeration selection in a constructor. Thanks for the help.
source share