Code:
I also need some help
--------------------------------------------------------------------------------
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
char cAgain;
int iDataset = 1;
double dRoot, dValuea, dValueb, dValuec;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(4);
do
{
cout << endl << "****************" << endl
<< "* Data Set " << iDataset << " *" << endl
<< "****************" << endl << endl;
cout << endl << "Please enter coefficients for quadratic equation"
<< " ax^2 + bx + c = 0" << endl << endl;
cout << endl << "Value of 'a' : " << endl;
cin >> dValuea;
cout << "Value of 'b' : " << endl;
cin >> dValueb;
cout << "Value of 'c' : " << endl;
dRoot = (- dValueb +/- sqrt(pow(dValueb, 2) - 4 * dValuea * dValuec))/ 2 * dValuea;
cout << endl << "You have entered the equation " << dValuea
<< "x^2 + " << dValueb << "x + " << dValuec << " = 0" << endl;
cout << endl << "The root to this equation is: " << endl << endl << dRoot;
cout << endl << "Want to do this again? Y/y/N/n" << endl << endl;
cin >> cAgain;
iDataset++;
} while (cAgain == 'Y' || cAgain == 'y');
return 0;
}
program2.cpp:38 : error: expected primary-expression before '/' token
line 38 starts with dRoot =
Comment