Software development methodology, lab 1
The Quadratic Equation Solver is a console application that allows users to solve quadratic equations in two different modes: Interactive and Non-interactive (File) mode.
Example of quadratic equation: ax^2 + bx + c = 0, where a ≠ 0
In the Interactive mode, the application is launched without any command-line arguments. It prompts the user to enter the three coefficients (a, b, and c) of the quadratic equation one by one. After receiving the coefficients, it calculates and displays the resulting equation and the roots.
In the Non-interactive mode, the program accepts a single command-line argument, which is the path to a file containing the coefficients of the equation. The file should have three numbers (a, b, and c) separated by a space. The decimal symbol expected is a dot. After the last coefficient (c), there should be a newline character (\n) to signify the end of the file. The program reads the coefficients from the file, solves the quadratic equation, and displays the results.
- Clone the repository to your local machine:
git clone https://github.com/mikhmol/SDM_Lab1
-
Install Node.js, if not installed.
-
Open a terminal and navigate to the folder with this program:
cd ./SDM_Lab1
- Install the dependencies:
npm i
- To run program in interactive mode:
node main.js
- To run program in non-interactive mode (you need have a .txt file with three arguments, for example: 1 2 3)
node main.js path-to-file