// rootsUI.cc
// Simple text-based interactive user interface for
// finding the roots of polynomials

#include <iostream>

void readCoefficients(float& a, float& b, float& c)
{
  cout << "Enter coefficient for cuadratic term (a): ";
  cin >> a;
  cout << "Enter coefficient for linear term (b): ";
  cin >> b;
  cout << "Enter coefficient for constant term (c): ";
  cin >> c;
}

void reportRoots(float a, float b, float c,
		 int numRoots, float root1, float root2)
{
  cout << "a = " << a
       << " b = " << b
       << " c = " << c
       << ":: ";
  switch (numRoots) {
  case 0: 
    cout << "No real roots"
	 << endl;
    break;
  case 1: 
    cout << "One real root: "
	 << root1 
	 << endl;
    break;
  case 2: 
    cout << "Two real roots: "
	 << root1
	 << " and "
	 << root2
	 << endl;
    break;
  default:
    cout << "Error: bad number of roots"
	 << endl;
  }
}
