Reference no: EM132267050
Assignment - JAVA Project Polynomial Arithmetic with HashMap
Instructions: JAVA programs with HashMap two polynomials and will be able to do arithmetic with them. Want addition, subtraction, multiplication, division and remainder to be implemented. Please use Template on attachment
Projects must be submitted as a ZIPPED FOLDER with the folder name as Y{8 Digit #} *for example the folder name is Y12345678 Within the folder will only be source code, NO .class files. The files in the folder will be:
1) Y12345678.java
2) Utility.java
3) Polynomial.java
4) PolynomialInterface.java
Any projects that do not compile or work will receive a 0. Excuses such as "It compiles on my computer" or "It worked last time" will not be accepted. Your program must work on all machines not just yours. If you are using an IDE such as eclipse, before submitting, remove all package statements from all files. Project Specs: You have been hired by a math teacher to help write a program that will read in any two polynomials and will be able to do arithmetic with them. They want addition, subtraction, multiplication, division and remainder to be implemented.
The input will be two polynomials in string form:
"X^5+2X^2+3X^3+4X^4"
"2X^2+4X"
The output will should be:
Sum: X^5 + 4.0 X^4 + 3.0 X^3 + 4.0 X^2 + 4.0 X
Difference: X^5 + 4.0 X^4 + 3.0 X^3 -4.0 X
Product: 2.0 X^7 + 12.0 X^6 + 22.0 X^5 + 16.0 X^4 + 8.0 X^3
Quotient: 0.5 X^3 + X^2 -0.5 X + 2.0
Remainder: -8.0 X
You will be using a HashMap to accomplish this task. Implementation is up to you. You must parse each string using the Java String API. It is important that you learn how to parse strings and break them down into the information that you need. You will probably spend 50% of your time parsing the strings into its individual terms. To check if your output is correct, you can do the math yourself, or go on wolfram alpha. You are supplied with an outline. DO NOT CHANGE THE INTERFACE, UTILITY CLASS, OR THE MAIN METHOD. You may change the two input strings for testing, but change it back to original state before you submit it.
Attachment:- Assignment Files.rar