Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ <h1>Basic Formulas</h1>
<li>Select the Console Tab</li>
<li>Begin typing JS functions to test output</li>
</ol>

</body>
</html>
60 changes: 33 additions & 27 deletions js/formulas.js
Original file line number Diff line number Diff line change
@@ -1,80 +1,86 @@
// 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;
return .5 * base * height;
}
areaTriangle(6,8)

function Circle(radius){
return -1;
function Circle(radius) {
return (radius * radius * Math.PI);
radius(10)
}

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
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;
}
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +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"
}