im trying to make a small program to calculate fuel
it would have something where you enter the BLM (a number) and the VE (the original fuel number) and it would calculate the new VE. the BLM is supposed to be 128 so when its off I would have to calculate it all manually otherwise.
so the equation would look like this:
BLM/128 = X * VE = new VE
but if the BLM was above 128 it would have to add to the VE, if it was below it would subtract.
can anyone help?
.....
BLM/128 = X; // are you dividing the blm by 128 or is that what blm equals?
X * VE = new_VE;
if ( BLM < 128 ) {
new_VE - BLM;
cout << new_VE;
}
else if ( BLM > 128 ) {
new_VE + BLM;
cout << new_VE;
}
I dont think i totally understand your question but what i think u meant i left some code for. could you specify more.. do you have any sample code?
Last edited by Deathcry; 02-28-2007 at 08:25 PM.
the code is with you
If admin could just delete this. posted it on accident
the code is with you
thanks for the reply. yes im dividing the blm by 128 because thats what its supposed to be. so X is how much its off by. then I take X * the VE I have right now to get the new VE. hope that makes sense. im trying to make it as simple as possible without schooling everyone on tuning here lol
heres an example,
I had a BLM of 130 and an original VE of 6.25 so this is what I would do
130/128=1.05*6.25=6.56
old blm, what blm should be, X, VE, new VE
actually now that I think about it, the adding and subtracting if the blm was above/below 128 doesnt matter since you can just multiply X by the VE
didnt have much time but is this what you wanted?
Code:#include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { double blm, x, ve, new_ve; cout << "Insert BLM "; cin >> blm; cout <<"Insert VE "; //not sure how you wanted if you insert or pre set number cin >> ve; x = blm / 128; new_ve = x * ve; if ( blm < 128 ) { new_ve - blm; cout << new_ve; } else if ( blm > 128 ) { new_ve + blm; cout << new_ve; } system("PAUSE"); return 0; }
the code is with you
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks