// 22.5HV2 Software Engineering II // Unit 1 Exercise 4 #include #include #include #include // needed for atoi(), atof() float poly(float, float, float, float=0, float=0, float=0, float=0); int main(int argc, char *argv[]) { ofstream outs; int i, order; float x, coeff[6], x_start, x_end, x_inc; if ( argc!=5 ) { cerr << "USAGE: ex4 fileout start end inc" << endl; return 1; } outs.open(argv[1]); if ( outs.fail() ) { cerr << "Error opening " << argv[1] << endl; return 1; } x_start = atof(argv[2]); x_end = atof(argv[3]); x_inc = atof(argv[4]); cout << "Enter order of polynomial (1-5) : "; cin >> order; for (i=0;i<=order;i++) { cout << "Enter coefficient for power " << i << " : "; cin >> coeff[i]; } for (x=x_start;x