From 7f15f9cde5554f79cad8e82f9a3f4e5d638fa0c0 Mon Sep 17 00:00:00 2001 From: kcee917 Date: Sun, 24 Jan 2021 14:01:32 -0500 Subject: [PATCH 1/4] done --- index.html | 1 + js/formulas.js | 35 ++++++++++++++++++++--------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/index.html b/index.html index d66c928..d93de87 100644 --- a/index.html +++ b/index.html @@ -12,5 +12,6 @@

Basic Formulas

  • Select the Console Tab
  • Begin typing JS functions to test output
  • + diff --git a/js/formulas.js b/js/formulas.js index 2435d53..ae99f81 100644 --- a/js/formulas.js +++ b/js/formulas.js @@ -1,37 +1,42 @@ // Basic math formulaas function addition(num1, num2){ - return -1; -} + return num1 + num2;} +addition(2, 3) function subtraction(num1, num2){ - return -1; -} + return num1 - num2;} +subtraction(5,3) function multiplication(num1, num2){ - return -1; -} + return num1 * num2;} + multiplication(5, 5) function division(num1, num2){ - return -1; -} + return num1 / num2;} + division(36, 3) // Area formulaas -function areaSquare(side){ - return -1; -} +function areaSquare(num){ + let A = (num * num * num * num) + return A;} + areaSquare(2) + function areaRectangle(length, width){ - return -1; -} + return length * width;} + areaRectangle(6,4) function areaParallelogram(base, height){ - return -1; -} + return base * height;} + areaParallelogram(8,4) function areaTriangle(base, height){ return -1; } +function Circle(radius) { + return (radius * radius * Math.PI);} + radius(10) function Circle(radius){ return -1; } From 1e9481386e40c48c3c51d6518492c16c8e38741a Mon Sep 17 00:00:00 2001 From: Kim Chase Date: Sun, 24 Jan 2021 16:23:55 -0500 Subject: [PATCH 2/4] Added codes to functions circle, surface areas --- js/formulas.js | 21 +++++++++++---------- package-lock.json | 6 ++++++ package.json | 1 + 3 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 package-lock.json create mode 100644 package.json diff --git a/js/formulas.js b/js/formulas.js index ae99f81..6b96248 100644 --- a/js/formulas.js +++ b/js/formulas.js @@ -17,8 +17,8 @@ function division(num1, num2){ // Area formulaas function areaSquare(num){ - let A = (num * num * num * num) - return A;} + let a = (num * num * num * num) + return a;} areaSquare(2) @@ -27,31 +27,32 @@ function areaRectangle(length, width){ areaRectangle(6,4) function areaParallelogram(base, height){ - return base * height;} + return base * height; +} areaParallelogram(8,4) function areaTriangle(base, height){ - return -1; + return .5 * base * height; } + areaTriangle(6,8) function Circle(radius) { - return (radius * radius * Math.PI);} + return (radius * radius * Math.PI); radius(10) -function Circle(radius){ - return -1; } function Sphere(radius){ - return -1; + return (4 * Math.PI * (radius * radius)); } +radius(8) // Surface Area formulas function surfaceAreaCube(side){ - return -1; + return 6(Math.pow(side,2)); } function surfaceAreaCylinder(radius, height){ - return -1; + return 2 * Math.PI * radius * height; } // Perimeter formulas diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..6eba0c0 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "RR-JS-Basics", + "lockfileVersion": 2, + "requires": true, + "packages": {} +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/package.json @@ -0,0 +1 @@ +{} From c73716b161911825255624b332c39bcc1e7506c7 Mon Sep 17 00:00:00 2001 From: Kim Chase Date: Sun, 24 Jan 2021 16:39:46 -0500 Subject: [PATCH 3/4] All formulas complete --- js/formulas.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/js/formulas.js b/js/formulas.js index 6b96248..bfd4459 100644 --- a/js/formulas.js +++ b/js/formulas.js @@ -57,30 +57,30 @@ function surfaceAreaCylinder(radius, height){ // Perimeter formulas function perimeterSquare(side){ - return -1; + return 4(side); } function perimeterRectangle(length, height){ - return -1; + return 2(length) + 2(width); } function perimeterTriangle(side1, side2, side3){ - return -1; + return side1 + side2 + side3; } function perimeterCircle(diameter){ - return -1; + return Math.PI * diameter; } // Volume formulas function volumeCube(side){ - return -1; + return Math.pow(side,3); } function volumeRectangular(length, width, height){ - return -1; + return length * width * height; } function volumeCylinder(radius, height){ - return -1; + return Math.PI * Math.pow(radius,2) * height; } From 86e03728c5fb01a45e57ebd44cc2de48ce802acb Mon Sep 17 00:00:00 2001 From: kcee917 Date: Wed, 17 Mar 2021 12:08:54 -0400 Subject: [PATCH 4/4] commit --- package-lock.json | 11 +++++++++-- package.json | 20 +++++++++++++++++++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6eba0c0..78c6f34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,13 @@ { - "name": "RR-JS-Basics", + "name": "rr-js-basics", + "version": "1.0.0", "lockfileVersion": 2, "requires": true, - "packages": {} + "packages": { + "": { + "name": "rr-js-basics", + "version": "1.0.0", + "license": "ISC" + } + } } diff --git a/package.json b/package.json index 0967ef4..8538d2a 100644 --- a/package.json +++ b/package.json @@ -1 +1,19 @@ -{} +{ + "name": "rr-js-basics", + "version": "1.0.0", + "description": "## Tech Stack A list of expected technology to be used in this assignment", + "main": "index.js", + "scripts": { + "test": "npm test" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/kcee917/RR-JS-Basics.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/kcee917/RR-JS-Basics/issues" + }, + "homepage": "https://github.com/kcee917/RR-JS-Basics#readme" +}