Ive been working a compression calculator and am struggling because after my program accepts the first input inside an "if" statement, it quickly skips through the second two inputs, I even included a system("pause") to attempt to slow things down.
On top of that issue the value of P1+P2+P3 (MTR) is always zero... Even if only the first number is excepted, MTR should not equal zero.
This is the section of code I am thinking things go wrong. Any help is greatly appreciated.
cout<< "Enter 1 to look at the engine library or 2 to begin the compression ratio calculator.";
cin>> x;
if (x==2)
{
cout<<"Enter the engine code of the Block you would like to use"<<endl;
cin>> P1;
cout<<"Enter the engine code for the Pistons/Connecting Rods/ Crank you would like to use"<<endl;
cin>> P2;
cout<<"Enter the engine code for the Head you would like to use"<<endl;
cin>> P3;
}
MTR= P1+ P2+ P3;
cout<<"The Compression Ratio you created is"<< MTR << "." <<endl;