|
||||||
| General Programming Non language specific, Assembly, Linux/Unix, Mac and anything not covered in other topics. Talk about Programming Theory here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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? |
| Sponsored Links |
|
|
|
|||
|
Quote:
|
|
|||
|
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 |
| Sponsored Links |
|
|
|
|||||
|
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 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Best program for SQL database manipulation | Rhadamanthys | Database & Database Programming | 3 | 07-02-2007 03:32 PM |
| How do I Program another Program? ! | bosco | General Programming | 1 | 06-15-2007 12:15 PM |
| Need help w/ word count program (ASAP) | siren | C and C++ | 1 | 04-23-2007 09:14 AM |
| How to modify a program written in .NET 2.0? | jackyjack | C# Programming | 7 | 03-27-2007 01:26 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 98%