Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

no overload for method 'METHOD' takes 0 arguments

I have 3 methods.

1 method holding the value of 3000 1 method holding the value of 0.13

and I have created another method that I want to multiply these two figures together.

public override int FishPerTank()
{                
    return 3000;                
}

public override double WeightOut(double weightOut, double weightIn)
{
    return 0.13;
}

public override int HowMuchTheFishWeighOutKG()
{
    return (FishPerTank() * WeightOut());
}

I am receiving the syntax error on the WeightOut here:

public override int HowMuchTheFishWeighOutKG()
{
    return (FishPerTank() * WeightOut());
}
like image 397
Simagen Avatar asked Nov 27 '22 22:11

Simagen


2 Answers

WeightOut expect 2 parameters and you're not providing them

like image 110
Claudio Redi Avatar answered Dec 05 '22 06:12

Claudio Redi


WeightOut(double weightOut, double weightIn) is declared with two parameters and you're calling it with none. Hence the error.

like image 29
Brian Rasmussen Avatar answered Dec 05 '22 05:12

Brian Rasmussen