I have tried to get this program to run can somoene help me and tell me what wrong with it. It keeps giving me 22 errors when I try to compile it.
//*****************************************************
//*This program is to calculate the Quadratic formula**
//allowing user input
//@Author Larry Burden
//C++
//Program #2
//*****************************************************
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
//declaration
float x1 (float, float, float);
float x2 (float, float, float);
int main()
{
float b;
float a;
float c;
//Input/Output
cout<<"Enter the value of b"<<endl<<endl;
cin>>b;
cout<<"Enter the value of a"<<endl<<endl;
cin>>a;
cout<<"Enter the value of c"<<endl<<endl;
cin>>c;
//Output
cout<<The value of x1 equals to " <<setprecision (4)<< x1 (b,a,c) << endl<<endl;
cout<<The value of x2 equals to " <<setprecision (4)<< x2 (b,a,c) << endl<<endl;
return 0;
}
//formula
float x1 (float b, float a, float c)
{
return (-b + sqrt (pow(b,2) - (4.0*a*c)))/(2.0*a);
}
//*****************************************************
//*This program is to calculate the Quadratic formula**
//allowing user input
//@Author Larry Burden
//C++
//Program #2
//*****************************************************
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
//declaration
float x1 (float, float, float);
float x2 (float, float, float);
int main()
{
float b;
float a;
float c;
//Input/Output
cout<<"Enter the value of b"<<endl<<endl;
cin>>b;
cout<<"Enter the value of a"<<endl<<endl;
cin>>a;
cout<<"Enter the value of c"<<endl<<endl;
cin>>c;
//Output
cout<<The value of x1 equals to " <<setprecision (4)<< x1 (b,a,c) << endl<<endl;
cout<<The value of x2 equals to " <<setprecision (4)<< x2 (b,a,c) << endl<<endl;
return 0;
}
//formula
float x1 (float b, float a, float c)
{
return (-b + sqrt (pow(b,2) - (4.0*a*c)))/(2.0*a);
}