Java Program HashMap

Given two polynomials in form of strings. Write a Java program that adding, subtracting, and multiplying two polynomials using maps.


The input will be two polynomials in the following form of strings, for example,

“(-4.5)X^1 + (-2.5)X^0 + 1X^3”

“1X^2 + 1X^0”


Polynomial p: X^3 -4.5X -2.5

Polynomial q: X^2 + 1.0

p+q: X^3 + X^2 -4.5X -1.5

p-q: X^3 -X^2 -4.5X -3.5

p*q: X^5 -3.5X^3 -2.5X^2 -4.5X -2.5


Using a Java HashMap or TreeMap to represent a polynomial. Each term will be saved as a key-value entry in the map. The size of the map will be the number of terms in the given polynomial or less.

After you parse the input strings, you should insert the terms into your HashMap or TreeMap immediately. To parse a string, you may refer to the Java StringTokenizer class or String class.

You may add more test cases in the main method but remember to change the main method back to the original state before you submit the project.

Classes required for the project:

Polynomial class holds a HashMap or TreeMap associated with a polynomial. Polynomial arithmetic must be done in the Polynomial class. You should also implement a toString() method to print out polynomials.

The main method must be in the HW3 class.

IT IS USING HASHMAP not LinkedList . Attaching files to modify.

Taidot: Java, Ohjelmointi

Näytä lisää: write program java graphical user interface, write program java deposit money, write program java tube, write program java calculate payment amount mortgage loans, write program java read text files randomly, write program simulates airline reservation system java, write program java convert xml file sql database

Tietoa työnantajasta:
( 1 arvostelu ) Brooklyn, United States

Projektin tunnus: #32294310

Myönnetty käyttäjälle:


Hi there, I checked your requirements and guarantee you it's gonna be done within the next few hours. Let's contact via chat so that I can start work immediately. Wish you the best. ------------------------------

$30 USD 2 päivässä
(40 Arvostelua)

3 freelanceria on tarjonnut keskimäärin $35 tähän työhön


⭐⭐⭐C/C++/Python/Java Expert⭐⭐⭐ Dear sir. I have checked your project and it is very interesting. I have an experience of attending ICPC so I am very familiar with algorithm with c/c++/python/java. Hope to meet and have Lisää

$50 USD 1 päivässä
(6 arvostelua)

******** JAVA Expert here ******* Hello I have deep and Solid foundation in JAVA. I have 5 year experience with such project with algorithm & data structure. I am focus on client's requirement and trying to satisfy y Lisää

$25 USD 1 päivässä
(3 arvostelua)