0% found this document useful (0 votes)
7 views1 page

MAT 121 - Assignment - 03

Do this to improve your programming skills

Uploaded by

victorabioye124
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

MAT 121 - Assignment - 03

Do this to improve your programming skills

Uploaded by

victorabioye124
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

MAT 121 :: Coding in Mathematics I

Assignment 3

February 12, 2024

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

1 This assignment is designed to test the students’ understanding of basic input-output

operations and their ability to handle different scenarios in solving quadratic equations.

You might also like