// quadratic.cpp
// Computes the value of a quadratic expression.
#include <iostream>
using namespace std;
int main()
{
// Announce purpose of program:
cout << "This program computes the value of "
<< "a quadratic expression." << endl;
// Input coefficients from user:
cout << "Enter value of quadratic coefficient a:>";
float a; // to be input from user
cin >> a;
cout << "Enter value of linear coefficient b:>";
float b; // to be input from user
cin >> b;
cout << "Enter value of constant term c:>";
float c; // to be input from user
cin >> c;
// Input value of variable x:
cout << "Enter value of variable x:>";
float x; // to be input from user
cin >> x;
// Compute value of quadratic expression:
float y = a*x*x + b*x + c;
// Output results:
cout << "The value of the quadratic expression is "
<< y << endl;
return 0;
} // function main