Question: Please use java The overall purpose of the lab is to find rational roots, real or complex roots, for a quadratic equation. There are many
Please use java
The overall purpose of the lab is to find rational roots, real or complex roots, for a quadratic equation. There are many layers and steps to get the full program to work so you may just do part of the lab, like find just the real roots. You will need to change your types for a, b, and c, to different types as you enhance your lab in each step; start with int types then eventually to Fraction types so that you can get any possible rational root and complex root. There are several possible classes needed for the entire project; Main, Quadratic, Complex and Fraction are all different classes that are part of the project.
You will need to hand in every class that you used in your client to find the roots.
Each test case that you used to validate that your program works should be attached to the end of the client as a comment.
Step 1: (5 pts)
Find the real roots of a quadratic equation. If the roots are complex then indicate that in the output but don't calculate them.
You need to have a Main class and a Polynomial class with appropriate methods and fields.
Step 2: (15 pts)
Make a complex class that has two fields that are int types.
Follow the guidelines listed:
- two fields that are int types
- appropriate constructors to make a complex number
- all four operations: + - * /
- toString() method to display a complex number: (4 )+ (5)i
Step 3: (15 pts)
Make a complex class that has two fields that are Fraction types.
Follow the guidelines listed:
- two fields that are Fraction types( we will be writing Fraction class in another lab that you can include in this lab)
- appropriate constructors
- all four operations: + - * /
- toString() method to display a complex number: (4/3 )+ (5/7)i
Step 4:( 5pts)
Find any rational roots, real or complex, for a quadratic equation using your classes you created.
You will need to hand in every class that you used in your client to find the roots.
Each test case that you used to validate that your program works should be attached to the end of the client as a comment.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
