Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 1.35 KB

File metadata and controls

32 lines (26 loc) · 1.35 KB

Quadratic Equation Solver - Java Assignment 005

Instructions:

  1. Fork this repository to your GitHub account.
  2. Clone the forked repository locally to your machine.
  3. Create a new branch named Feature01.

Assignment

Objective: Create a file named src/Quadratic.java and write a program that calculates the roots of the quadratic equation: $$ax^2 + bx + c = 0$$ using the quadratic formula: $$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$

Requirements:

  • Prompt the user to input integers for (a), (b), and (c).
  • Compute the two solutions for (x) using the quadratic formula.
  • Display the results.

Additional Instructions:

  • Your program should handle inputs where there is only one or no solution. Avoid division by zero or taking the square root of a negative number.
  • Validate all inputs to prevent input mismatch exceptions.
  • Display specific error messages that include details about invalid input.

Submission

Follow these steps for submission:

  1. Create a Feature01 branch of your code if you haven't already.
  2. Commit your working code for the quadratic equation solver to your local copy/Feature01 branch.
  3. Push it to your Remote/origin branch (i.e., GitHub: Feature01 -> origin/Feature01).
  4. Issue a Pull request to my instructor repo.
  5. Make sure to COPY the Pull request URL and submit it for the lab/assignment in Canvas.