Quadratic Equation Solver CLI

Overview

Quadratic Equation Solver

This is lab 1 for Software Development Methodologies and Technologies

This tiny CLI program written in Swift lets you solve quadratic equations

Installation

  1. Be sure that you have installed Git to clone the repository and Swift to run script

  2. Clone the repository to you local machine

git clone https://github.com/MrPaschenko/quadratic-equation-solver
  1. Open directory
cd quadratic-equation-solver/Quadratic\ Equation\ Solver
  1. Run script
swift main.swift

Usage

There are two modes supported:

  1. Interactive
  2. Noninteractive

To change mode, comment/uncomment 55/56 lines.

Interactive

Just enter real numbers for a, b, c variables and script will solve the problem!

Welcome to Quadratic Equation Solver!
ax^2 + bx + c = 0
Please, enter real numbers
> a = 2
> b = 1
> c = -3
Equation is: (2.0) x^2 + (1.0) x + (-3.0) = 0
Discriminant is 25.0
There are 2 roots
x1 = 1.0
x2 = -1.5

Noninteractive

Enter path to file to solve the problem.

Welcome to Quadratic Equation Solver!
Please, enter path to file
> Documents/file.txt
Equation is: (1.0) x^2 + (0.0) x + (0.0) = 0
Discriminant is 0.0
There is 1 root
x = -0.0

File's content should be as follows:

1 0 0

or

1\s0\s0\n

Revert commit

You might also like...
A starting point to create CLI utilities with swift

cli tuist template A starting point to create CLI utilities with swift Installation Just create a Tuist folder and a Templates folder inside it. Creat

A Tuist Template to quickly create CLI apps in Swift

macOS CLI Template Motivation I'm writing more and more Swift CLI apps these days. And as I solve more problems with this litte tools, I find that I'm

A cli program written in swift (with async/await) that removes the unnecessary parts of xcframeworks.

xctrim A cli program written in swift (with async/await) that removes the unnecessary parts of xcframeworks. Usecase Say you downloaded firebase sdk a

CLI for setting location in the iOS simulator

set-simulator-location This is a simple CLI for easily setting the location of the currently running iOS Simulator. Usage Set a specific latitude and

A CLI tool for localization resource management on Xcode. Built with Google Translator.
A CLI tool for localization resource management on Xcode. Built with Google Translator.

Supported by Jetbrains Open Source License Program Automatically translate and synchronize '.strings' files from the defined base language The basic c

An extremely simple CLI tool that was created to diagnose and further understand an issue in DriverKit causing kIOHIDOptionsTypeSeizeDevice to behave incorrectly when used in DriverKit system extensions.

IOKitHIDKeyboardTester This tool is NOT useful to, or intended for general users. IOKitHIDKeyboardTester is an extremely simple (one-file!) CLI tool t

A CLI tool for the survey of the SSH-Key strength in your GitHub organization members.

GitHub organization SSH-keys checker A CLI tool for the survey of the SSH-Key strength in your GitHub organization members. Requirements macOS 12.0+ S

A library and CLI Utility to manage NVRAM Stuff, written in Swift.

NVRAMKit A Library and CLI Utility to manage NVRAM Stuff, written in Swift. Library Adding Library to Project Simply add this line to the dependencies

Swift CLI for strong-typing images, colors, storyboards, fonts and localizations

Shark Shark is a Swift command line tool that generates type safe enums for your images, colors, storyboards, fonts and localizations. Because Shark r

Phiole - Allow to write or read from standards stream or files for script or CLI application

No longer maintained! Phiole - Φole Simple object to wrap three NSFileHandle: 'output', 'error' to write and 'input' to read There is of course a defa

Snpm - Snippet Manager CLI With Swift

Snippet Manager CLI Usage foo@bar:~$ snpm --help OVERVIEW: Utill for searching s

Swift-cli - Example of building command-line tools in Swift
Swift-cli - Example of building command-line tools in Swift

swift-cli Example of building command-line tools in Swift Step 1: Create CLI wit

ConcurrentTest - Swift macOS CLI example on how to NOT do concurrent coding
ConcurrentTest - Swift macOS CLI example on how to NOT do concurrent coding

Swift Concurrent Test Open the .xcodeproj file in Xcode, and try running it seve

A CLI utility to check or uncheck Open Using Rosetta preference for Apple Silicon macs.
A CLI utility to check or uncheck Open Using Rosetta preference for Apple Silicon macs.

SetArchPrefForURL A CLI utility to "check" or "uncheck" "Open Using Rosetta" preference for Apple Silicon macs. Usage: SetArchPrefForURL path-to-the-

Text-cli - Command line tool for extracting text from images using Apple's Vision framework
Text-cli - Command line tool for extracting text from images using Apple's Vision framework

text-cli Command line tool for extracting text from images using Apple's Vision

The new iOS video player for CLI Studio

CLIPlayer Description The new iOS video player for CLI Studio Example To run the example project, clone the repo, and run pod install from the Example

CLI tool to fetch a webpage's contents after it has finished loading

webpage-dl Fetch a webpage's contents via CLI after it has finished loading. Scraping HTML from webpages can't always be done via curl as it is often

A CLI to Alcatraz, the Xcode package manager.
A CLI to Alcatraz, the Xcode package manager.

Azkaban This project is deprecated in favor of Editor Extensions support in Xcode 8+. A CLI to Alcatraz, the Xcode package manager. Usage Install a pl

Aplikasi iOS Simulasi CRUD Stok Barang dengan SwiftUI, Firebase CLI & Firestore
Aplikasi iOS Simulasi CRUD Stok Barang dengan SwiftUI, Firebase CLI & Firestore

iStockery Aplikasi iStockery adalah aplikasi stok inventory berbasis iOS yang dibuat menggunakan Firebase (Firestore) secara Local dengan fitur CRUD d

Owner
Dmytro Pashchenko
KPI FICT student
Dmytro Pashchenko
A Swift port of the Cassowary linear constraint solver

Cassowary Swift A Swift port of the Cassowary linear constraints solver. Tested on OS X, iOS and Linux. Example usage let solver = Solver() let left

Tribal Worldwide London 110 Oct 18, 2022
Beautiful math equation rendering on iOS and MacOS

iosMath iosMath is a library for displaying beautifully rendered math equations in iOS and MacOS applications. It typesets formulae written using the

Kostub Deshmukh 1.3k Dec 21, 2022
App for LaTeX quick reference and light equation editor

LaTeX Draft I miss the LaTeX Help app, which is too ancient to work under the latest iOS unfortunately. So I will write one in hommage to LaTeX Help a

mizu-bai 1 Mar 9, 2022
Wordle-solver - A little command line app for finding the answer to Wordle

A little command line app for finding the answer to Wordle puzzles, written in S

Dalton Claybrook 6 Nov 2, 2022
Guaka - Smart and beautiful POSIX compliant CLI framework for Swift.

Guaka - Smart and beautiful POSIX compliant CLI framework for Swift. It helps you create modern and familiar CLI apps in the vein of widely used proje

Omar Abdelhafith 1.1k Dec 24, 2022
Simple CLI utility to save off an image from every webcam hooked into a mac

macOSCameraCapture Simple CLI utility to save off an image from every webcam connected to the macOS machine. This utility is meant for research and te

Cody Thomas 12 Jan 26, 2022
A silly CLI for replacing macosx.internal SDK settings in .xcodeproj files with macosx

fix-macos-internal-sdk A silly CLI for replacing macosx.internal SDK settings in .xcodeproj files with macosx.

Keith Smiley 14 Dec 6, 2022
A CLI too powered by Swift to provision environments using an up.toml manifest file

tuist-up tuist up was originally a Tuist built-in command to provision environments by reading the requirements in a manifest file Setup.swift. Althou

Tuist 5 Mar 31, 2022
CLI tool for macOS that transcribes speech from the microphone using Apple’s speech recognition API, SFSpeechRecognizer. (help.)

CLI tool for macOS that uses SFSpeechRecognizer to transcribe speech from the microphone. The recognition result will be written to the standard output as JSON string.

Thai Pangsakulyanont 23 Sep 20, 2022
SuccessorCLI A CLI tool to restore iOS Devices on versions they're already on, based on the original Succession

A tool to restore iOS Devices on versions they're already on, based on the original Succession

Dabezt 11 Dec 26, 2022