double usd, usd2;
for (int x = 0; x < 14; x++)
{
if (usd >= principle[x * 2] && usd <= principle[x * 2 + 1])
{
usd2 = usd + fee[x];
break;
}
}
peso = usd2 * 50.26;
principle[]
is an array of price ranges principle[0] - principle[1]
. usd2
is supposed to be the usd
with an added fee. I wanted to use the usd2
after but it errors at the `peso = usd2 * 50.26 and it says "use of unassigned local variable usd2".
Should I use return? I am using an array to check the price usd in the principle(price ranges). I am using c#