954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

wuts wrong with my code here?

the purpose of this is to find the percent of error of a trnsducer and the overall error.
I'm kinda stuck can you guys quickly take a look at it please

[PHP]
#include
#include
using namespace std;

void main()
{
float td_1, td_2, td_3, ktd_1, ktd_2, ktd_3,
err_1, err_2, err_3, sum;
double ovrlerr;


cout << "Enter the known value of Transducer 1 ";
cin >> ktd_1;
cout << "Enter the known value of Transducer 2 ";
cin >> ktd_2;
cout << "Enter the known value of Transducer 3 ";
cin >> ktd_3;
cout << endl << "#####################################";

cout << endl << "Enter the tested force for Transducer 1 ";
cin >> td_1;
err_1 = fabs((td_1 - ktd_1)/ktd_1) * 100;
cout << "Percent error of Transducer 1 = " << err_1 < 7.5)
cout << "Transducer 1 needs to be Replaced" << endl;
else
cout << "Transducer 1 is good for Crash Test";

cout << endl << "Enter the tested force for Transducer 2 ";
cin >> td_2;
err_2 = fabs((td_2 - ktd_2)/ktd_2) * 100;
cout << "Percent error of Transducer 2 = " << err_2 < 7.5)
cout << "Transducer 2 needs to be Replaced" << endl;
else
cout << "Transducer 2 is good for Crash Test";

cout << endl << "Enter the tested force for Transducer 3 ";
cin >> td_3;
err_3 = fabs((td_3 - ktd_3)/ktd_3) * 100;
cout << "Percent error of Transducer 3 = " << err_3 < 7.5)
cout << "Transducer 3 needs to be Replaced" << endl;
else
cout << "Transducer 3 is good for Crash Test" << endl ;


sum = (err_1 + err_2 + err_3);

ovrlerr = fabs((sum - (3*ktd_1))/(3*ktd_1)) * 100;

cout << "Overall error for all three Transducer is " << ovrlerr << endl;

if (ovrlerr > 5)
cout << "The test can not be carreid due to malfunction of the Transducers" << endl;
else
cout << "The Test can be carried on" << endl;


}

[/PHP]

thanks guys

lk9865
Newbie Poster
2 posts since Oct 2005
Reputation Points: 10
Solved Threads: 0
 

here is what the criteria looks like

lk9865
Newbie Poster
2 posts since Oct 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You