I'm doing a small task for UNI and I can't find the answer to this problem:
Inputting liner numbers works fine but when trying to insert decimal numbers in the console errors pop up
The code:
using System;
namespace Circle
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Radius R = ");
String radius = Console.ReadLine();
Double num1 = 3.1415926;
Double num2 = Int32.Parse(radius);
Double RLG = num2 * 2 * num1;
Double RL = Math.Pow(num2, 2) * num1;
Double LL = Math.Pow(num2, 2) * 4 * num1;
Double LT = Math.Pow(num2, 3) * 4 * num1 / 3;
Console.WriteLine("circle line length " + CLL);
Console.WriteLine("circle surface size " + CSS);
Console.WriteLine("sphere surface size " + SSS);
Console.WriteLine("sphere volume " + SV);
}
}
}