using System;
namespace area
{
class Program
{
static void Main(string[] args)
{
double basse;
double height;
Console.WriteLine("Enter your base length: ");
basse = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter the height: ");
height = Convert.ToDouble(Console.ReadLine());
double area = Program.triangleArea(basse, height);
Console.WriteLine("Your area is {0:f3}", area);
Console.ReadLine();
double pryrmid = Program.pyramidVolume(triangleArea);
Console.WriteLine(" Pyramid Volume is {0:f3}" , pryrmid);
}
public static double triangleArea(double basse, double height)
{
return (0.5 * basse) * height;
}
public static double pyramidVolume (double triangleArea)
{
return (1/3) * triangleArea;
}
}
}
我正在尝试使用定义的方法计算pryamid的体积。计算面积
我不断收到错误
参数 '1':不能从 '方法组' 到 '双'(CS1503)转换 - \ VMWare的主机\共享文件夹\文件\ SharpDevelop的项目\ WS_6_D \ WS_6_D \的Program.cs:28,57
和
为 最好重载方法匹配 'area.Program.pyramidVolume(双)' 具有一些无效的参数 (CS1502) - 目录\ VMware主机\共享文件夹\文件\ SharpDevelop的 项目\ WS_6_D \ WS_6_D \的Program.cs:28,34
我想知道,如果有人可以帮助我得到正确的跟踪。
谢谢,完美的作品:) – Evildommer5