If you're working with floating point numbers, you may want to reconsider the use of the int
data type.
This, for a start, is going to cause all sorts of grief:
int cashDepositOverLimitFee = 2.5;
You're better off using double
for everything.
In terms of finding the unknown variable here, that's something specific to your business rules, which aren't shown here.
I'd hazard a guess that the price/$1000
figure is intimately related to your cashDepositOverLimitFee
variable such as it being $2.50 for every extra $1000.
That would make the equation:
inputCash - cashDepsitFromPlan
cashDepositOverLimit = ------------------------------ * cashDepositOverLimitFee
1000
which makes sense. The first term on the right hand side is the number of excess $1000 lots you've deposited over and above the plan. You would multiply that by a fee rate (like $2.50 or 2.5%) to get the actual fee.
However, as stated, we can't tell whether it's $2.50 or 2.5% based on what we've seen. You'll have to go back to the business to be certain.