Julianna Greyjoy wrote: . . . Hopefully this is easier to read and properly formatted.
'Fraid it isn't. It should look like this:-
Welcome again
if (1 < packgwt) is much less easy to read than
if (packgwt >= 1)
Actually, that bit is redundant. If you use
else‑if, you have already excluded that. It is
if the weight is 1 or less,
otherwise if the weight is 3 or less
otherwise
It is always worth trying all sorts of different options with multiple
else‑ifs, because you can often find a neater solution. You may find you
must end with a plain simple
else, otherwise you may confuse the compiler into thinking the variable might not be initialised.