- static void Main(string[] args)
- {
- WriteLine("What is the radius of your circle: ");
- WriteLine("The area of your circle is: " + circleArea(Double.Parse(ReadLine())).ToString());
- ReadKey();
- }
- static double circleArea(double radius = 5.00)
- {
- return Math.PI * (radius * radius);
- }
So far the code I have is working and it is able to calculate the area of a circle; however, I need to have the main method pass an integer variable (radius) with an optional default value. I thought I had it by adding =5 to my second method, but that wasn't it.
Any help would be appreciated.