unsigned long gallonsRemain ()
{ signed long rem = parms[tankSizeIdx] - tank.gallons();
return (rem<0 ? 0 : rem);
}
unsigned long milesRemain ()
{ return gallonsRemain() * tank.mpg() / 1000; }
/* something like that. i dunno. i don't use 0.86, so i haven't tested the code.
how/where to display this figure is up to you. */
|