我似乎无法确定问题出在哪里。 pph,并且在不同的过载情况下都等于不同的值。我不确定我做错了什么。我不明白这些值是如何相同的。错误类型'Pay'已经定义了一个名为'ComputePay'的成员,其参数类型相同
public class Pay
{
public double ComputePay(double h,double pph,double with)
{
double net = 0;
try
{
double gross = h * pph;
net = gross - with;
}
catch (FormatException)
{
Console.WriteLine("Hour's cannot be less than zero");
}
return net;
}
public double ComputePay(double h, double pph, double with = 0.15)
{
double net = 0;
try
{
double gross = h * pph;
net = gross - with;
}
catch (FormatException)
{
Console.WriteLine("Hour's cannot be less than zero");
}
return net;
}
public double ComputePay(double h, double pph = 5.85, double with = 0.15)
{
double net = 0;
try
{
double gross = h * pph;
net = gross - with;
}
catch (FormatException)
{
Console.WriteLine("Hour's cannot be less than zero");
}
return net;
}
}
谢谢这是我误读我的作业 – TheAce 2013-03-11 15:51:55