I would like to write a program where the user will be asked for numbers which will be used to calculate the surface of a square. But I don't know how to "use" the entered numbers in my methods.
Thank you
Here is what I have done so far
static void Main(string[] args)
{
calculate();
}
public static void Height()
{
Console.WriteLine("Enter height of the square");
string enter1 = Console.ReadLine();
double height = Convert.ToDouble(enter1);
// height of the square
}
public static void Length()
{
Console.WriteLine("Enter length of the square");
string enter2 = Console.ReadLine();
double length = Convert.ToDouble(enter2);
//length of the square
}
static double calculate(double a, double b)
{
double summary = a * b;
Console.WriteLine(summary);
return summary;
}