The document describes debugging and modifying a C# program that creates a circle object. The program is debugged by fixing the constructor to properly set the radius. It is then modified to: add an overloaded getRadius() method that accepts an integer, call the overloaded method, add a getCircumference method to calculate circumference using the radius, and output the circumference calculation.
The document describes debugging and modifying a C# program that creates a circle object. The program is debugged by fixing the constructor to properly set the radius. It is then modified to: add an overloaded getRadius() method that accepts an integer, call the overloaded method, add a getCircumference method to calculate circumference using the radius, and output the circumference calculation.
The document describes debugging and modifying a C# program that creates a circle object. The program is debugged by fixing the constructor to properly set the radius. It is then modified to: add an overloaded getRadius() method that accepts an integer, call the overloaded method, add a getCircumference method to calculate circumference using the radius, and output the circumference calculation.
} public double getArea() { return radius*radius*Math.PI; }
static void Main(string[] args)
{ Program circle = new Program(); circle1.getColor(); circle1.getRadius(); Console.WriteLine("Area: " + circle1.getArea()); Console.ReadKey(); } }
2. Modify the program you have debugged to add the following:
A. Create an overloaded getRadius() that will accept an integer. B. Use the overloaded getRadius(). C. Create a method getCircumference to calculate the circumference of the circle. Formula: 2 * Math.PI * radius; D. Output the circumference of the circle.