Write the C# statements to add the static method Area to your Circle class. It s
ID: 3635173 • Letter: W
Question
Write the C# statements to add the static method Area to your Circle class. It should return a float and accept a parameter radius of type float. The area of a circle is Pi * r * r. In C# Pi can be accessed as Math.PI and is of type double.(Note: Do not re-type the class declaration, just provide the requested method.)
then write the C# statements to add the non-static method Area to your Circle class. It should return a float but not accept any arguments. This new Area method should not re-implement the equation for the area of a circle. Instead, you should invoke the static Area method you wrote in the previous statement.
Explanation / Answer
static float Area(float r)
{
return Math.PI*r*;
}
float Area()
{
return Area(r);
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.