Remainder Theorem
Author 
Message 
randint

Posted: Sat Oct 29, 2011 3:55 pm Post subject: Remainder Theorem 


The remainder theorem, known as P(x)/d(x), where P(x) is any polynomial, d(x) is a linear. When you use the the root of d(x) and "plug" it into P(x), you get the remainder of the function.
Description: 
This file uses the remainder theorem to get the remainder of the polynomial over another 

Download 
Filename: 
Remainder_Theorem.java 
Filesize: 
1.74 KB 
Downloaded: 
211 Time(s) 






Sponsor Sponsor



Zren

Posted: Sat Oct 29, 2011 6:28 pm Post subject: RE:Remainder Theorem 


You might want to consider showing which coefficient your input is for.
Eg: 'Enter coefficient n (nx^3): '
~
Also, when a user's input is incorrect, you should not be continuing.
You should either loop input until a valid input has been given, or you should be exiting your logic process when it happens.
code: 
C:\Users\Admin\Desktop>java Remainder_Theorem
Enter the highest degree term: 0
Enter coefficient: a
You have not entered a valid number!
Enter the slope: a
You have not entered a valid number!
0.0x is a factor of this polynomial.

I'll also hint that since you're getting a double as input more than once, that you should consider writing a function to getInputDouble() that'll do the looping/error catching inside of that, and would return a valid number.






randint

Posted: Sun Oct 30, 2011 1:00 pm Post subject: RE:Remainder Theorem 


Yes, this is correct, in the newer version, I will add System.exit (0); in the catch blocks.







