Ok well here is my inputPoly function. I know it contains either 1 or 2 other functions I haven't posted, but hopefully I won't have to.
Code:
struct list inputPoly ()
{
struct list ll = newList();
struct term *t;
float coef;
char var;
char choice;
int exp;
int cont = 1;
while (cont == 1)
{
printf ("Enter the coefficient: ");
scanf("%f", &coef);
while (getchar() != '\n');
printf ("Enter the variable: ");
scanf("%c", &var);
while (getchar() != '\n');
if (tolower(var) >= 'a' && tolower(var) <= 'z')
{
printf ("Enter the exponent: ");
scanf ("%d", &exp);
while(getchar() != '\n');
t = newTerm(coef, var, exp);
}
else
{
t = newTerm(coef, NOVAR, 0);
}
pushBack(&ll, t);
printf("Would you like to enter another? (y/n) ");
scanf("%c", &choice);
if (choice == 'y')
cont = 1;
else
cont = 0;
}
simplify(&ll);
return ll;
}
Thanks guys. Oh and this will be my last post until later on tonight, or maybe even Sunday night. I'll leaving to go out of town here in a minute. Thanks for the help!
-Squeage