MAT 121 - Assignment - 03
MAT 121 - Assignment - 03
Assignment 3
Objective:
The objective of this assignment is to implement a program that solves a
quadratic equation of the form ax2 +bx+c = 0 using the specified programming
language. The emphasis is on handling basic input-output challenges.
Instructions:
1. Choose one of the following programming languages: Python, PHP, JavaScript,
C++, or Wolfram Language.
2. Implement a program that takes coefficients a, b, and c as input (only real
numbers) from the user.
3. Ensure proper validation for the input coefficients, including checking for
non-numeric inputs.
4. Calculate the roots (consider both real and complex) of the quadratic
equation using the quadratic formula:
√
−b ± b2 − 4ac
x=
2a
5. Display the roots as output. Clearly indicate if the roots are real or
complex.
Submission:
Submit the source code file (as .pdf) along with a brief explanation of your
implementation, highlighting any input-output challenges you faced and how
you addressed them.
1
operations and their ability to handle different scenarios in solving quadratic equations.