Question: object Test3 (float x, float y, float radius) for this you will end up writting your own class called circle, make an instance of it,
object Test3 (float x, float y, float radius)
for this you will end up writting your own class called circle, make an instance of it, and return that instance. You will return an object that you make of type circle. in other words, if you were to make an object of type circle called c, you would return c from this test. you can put the circle class declaration either: in its own file called circle.cs or you can put it in the submission.cs file along side your submission class within the same namespace scope.
to create your circle class you will add the following access modifier, fields, constructor, and methods
your circle class must be declared as public. when you create your class called circle, you must make the class itself public. this means that you must put the keyword public directly before the word class
your circle must have 3 member variables (fields) of type float which represent
x position of the circle
y position of the circle and the radius of the circle
you can name the fields any name you want float mX; float mY; float mRadius; The prefix m stands for member variable
your circle must have an overload constructor, which takes 3 variables that will be assigned to the fields of this class public circle(float x, float y, float radius) the overload constructor should take the variables passed into the class and assign them to the fields your circle must have the following three accessor (getter) methods, each of which return one of the 3 fields of the class.
each accessor method must return the appropriate field public float GetX() public float GetY() public float GetRadius()
for this test when you have finished adding the above requested information to your circle class you will then make an instance object of type circle, calling its overloaded constructor passing the variables given to you in this test, and then you will return your class instance object from this test
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
