# seng560_assgn_1

> SENG 560 Programming Assignment 1

Latest version **1.0.10** (published 2021-09-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install seng560_assgn_1
pnpm add seng560_assgn_1
yarn add seng560_assgn_1
bun add seng560_assgn_1
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2021-09-24 |
| First published | 2021-09-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mike Horbatak |
| Maintainers | mhorbatak |

## Links

- npm: https://www.npmjs.com/package/seng560_assgn_1
- Repository: https://github.com/mhorbatak/SENG560_Assgn_1
- Homepage: https://github.com/mhorbatak/SENG560_Assgn_1#readme
- Issues: https://github.com/mhorbatak/SENG560_Assgn_1/issues
- npm.io page: https://npm.io/package/seng560_assgn_1

## Recent versions

- 1.0.10 (latest) — 2021-09-24
- 1.0.9 — 2021-09-24
- 1.0.8 — 2021-09-24
- 1.0.7 — 2021-09-24
- 1.0.6 — 2021-09-24
- 1.0.5 — 2021-09-24
- 1.0.4 — 2021-09-22
- 1.0.3 — 2021-09-21
- 1.0.2 — 2021-09-21
- 1.0.1 — 2021-09-21
- 1.0.0 — 2021-09-21

## README

# SENG 560 Programming Assignment 1 - Mike Horbatak

## Introduction
This is a NodeJS library that provides methods to compute basic arithmetic. These functions are as followed: 

- Addition
- Subtraction
- Multiplication
- Division
- Square Root
- Exponent
- Conversion between the various types (octal, hexadecimal, integer, binary).

## How to use this library

To install/add this library to your NodeJS application, install the library using the following command.
``` npm
npm install seng560_assgn_1
```

Next, within your application, initialize the library with the following code.

``` javascript
const math = require('seng560_assgn_1');
```
Once initialized, the following functions are available:

### Addition

``` javascript
var a = math.addNumbers(1, 3);
// this will compute: 1 + 3 = 4
console.log("The answer is: " + a);
```

### Subraction

``` javascript
var a = math.subractNumbers(4, 2);
// this will compute 4 - 2 = 2
console.log("The answer is: " + a);
```

### Multiplication

``` javascript
var a = math.multiplyNumbers(10, 6);
// this will compute 10 * 6 = 60
console.log("The answer is: " + a);
```

### Division

``` javascript
var a = math.divideNumbers(4, 2);
// this will compute 4 / 2 = 2
console.log("The answer is: " + a);
```

### Square Root

``` javascript
var a = math.squareRoot(9);
// this will compute the square root of 9 = 3
console.log("The answer is: " + a);
```

### Exponent

``` javascript
var a = math.exponentNumber(4,3);
// this will compute 4^3 = 64
console.log("The answer is: " + a);
```

### Number Conversion

``` javascript
var a = math.numberConvert(1100100, 2, 10);
// this will covert 1100100 (binary (base:2)) to 100(int (base:10))
/*
math.numberConvert(a,b,c);
a = the number you want to convert - will accept string and int values
b = the base of the number (a) being converted - e.g. 2(binary), 8(octal), 10(int), 16(hex)
c = the base the number/string will be converted to - e.g. 2(binary), 8(octal), 10(int), 16(hex)
*/
console.log("The answer is: " + a);
```

## Unit Testing
Mocha and Chai was used to unit test this library. Unit testing scripts can be found in the test directory.

---
_Source: https://npm.io/package/seng560_assgn_1 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
