Skip to content
Closed
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
52 changes: 26 additions & 26 deletions functions/sum/exercise/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>replit</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<script src="script.js"></script>
</body>

</html>



<!-- <form onsubmit="summarize()">
<label for="a">Input #1:</label><input type="text" name='a' id='a'/>
<br>
<label for="b">Input #2:</label><input type="text" name='b' id='b'/>

<button type="submit">Submit</button>
</form>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>replit</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script src="script.js"></script>
</body>
</html>
<!-- <form onsubmit="summarize()">
<label for="a">Input #1:</label><input type="text" name='a' id='a'/>
<br>
<label for="b">Input #2:</label><input type="text" name='b' id='b'/>
<button type="submit">Submit</button>
</form>
<div id="summary"> </div> -->
58 changes: 29 additions & 29 deletions functions/sum/exercise/script.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
/*
TODO: Write a function that sums two numbers
TODO: Write a function that subtracts two numbers
TODO: Write a function that divides two numbers.
TODO: Write a function that multiplies two numbers.
*NOTE* be sure to handle dividing by zero 😉
ES5 Syntax: function Add(){}
ES6 Syntax (Arrow function): const add = () => {}
*/

function add(){
//Add function here
}

function sub(){
//Subtract function here
}

function div(){
//Divide function here
}

function mul(){
//Multiply function here
}

console.log('hello from the SUM exercise')
/*
TODO: create a function that console logs the result of any of the above operations.
/*
TODO: Write a function that sums two numbers
TODO: Write a function that subtracts two numbers
TODO: Write a function that divides two numbers.
TODO: Write a function that multiplies two numbers.
*NOTE* be sure to handle dividing by zero 😉
ES5 Syntax: function Add(){}
ES6 Syntax (Arrow function): const add = () => {}
*/
function add(){
//Add function here
}
function sub(){
//Subtract function here
}
function div(){
//Divide function here
}
function mul(){
//Multiply function here
}
console.log('hello from the SUM exercise')
/*
TODO: create a function that console logs the result of any of the above operations.
*/
12 changes: 6 additions & 6 deletions functions/sum/solution/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<head>
<title>Sum - Solution</title>
</head>
<body>
<script src="script.js"></script>
</body>
<head>
<title>Sum - Solution</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
42 changes: 41 additions & 1 deletion functions/sum/solution/script.js
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
console.log("Sum solution"))
/*
TODO: Write a function that sums two numbers
TODO: Write a function that subtracts two numbers
TODO: Write a function that divides two numbers.
TODO: Write a function that multiplies two numbers.
*NOTE* be sure to handle dividing by zero 😉
ES5 Syntax: function Add(){}
ES6 Syntax (Arrow function): const add = () => {}
*/

// function add(){
// //Add function here
// }
const sum = (a, b) => {
return a + b
}

const sub = (a, b) => {
return a - b
}

const div = (a, b) => {
if(b === 0){
console.log('Cannot divide by 0');
} else {
return a / b
}
}

const mul = (a, b) => {
return a * b
}

console.log(sum(10, 4));
console.log(sub(10, 4));
console.log(div(10, 2));
console.log(mul(10, 4));

/*
TODO: create a function that console logs the result of any of the above operations.
*/
113 changes: 57 additions & 56 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,57 +1,58 @@
<div id="playground"></div>

<!-- https://github.com/CleverProgrammers/JavaScript-Course-by-Clever-Programmer- -->

<!DOCTYPE html>
<html>

<head>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Oswald&display=swap" rel="stylesheet">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">

<title>replit</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>


<body>
<h2>Official Github REPO (🌟 Go Star This ♥️)</h2>
<p>👉 <a href="https://github.com/CleverProgrammers/JavaScript-Course-by-Clever-Programmer-">JavaScript Course by Clever Programmer (Github Repo)</a></p>
<p>Let's get this trending 🚀</p>
<h3>Lessons</h3>
<a href="dom/red-yellow-green/index.html">DOM - Red Yellow Green Squares</a>
</br>
<a href="api/dogRandom/index.html">API - Get Random Dog</a>
</br>
<a href="api/superHero/index.html">API - Get Super Heroes</a></br>
<a href="classes/banksClass/index.html">Classes - Bank with Deposit & Withdraw Methods</a>

<h3>Project Exercises</h3>
<a href='projects/stopwatch/exercise/index.html'>Stopwatch</a><br>
<a href='projects/rockpaperscissors/exercise/index.html'>Rock Paper Scissors</a><br>
<a href='projects/fightingGame/exercise/index.html'>Figthing Game</a> <br>
<a href='projects/tip-calculator/exercise/index.html'>Tip Calculator</a>
<br>
<a href='projects/weather-app/exercise/index.html'>Weather App</a>

<h3>Project Solutions</h3>
<a href='projects/stopwatch/solution/index.html'>Stopwatch</a><br>
<a href='projects/rockpaperscissors/solution/index.html'>Rock Paper Scissors</a><br>
<a href='projects/fightingGame/solution/index.html'>Fighting Game</a></br>
<a href='projects/tip-calculator/solution/index.html'>Tip Calculator</a>
<br>
<a href='projects/weather-app/solution/index.html'>Weather App</a>
</br>
<a href='projects/fetchmovies/solution/index.html'>Create Netflix</a>

<script src="https://cdnjs.cloudflare.com/ajax/libs/prettier/2.6.2/standalone.js"></script>
<script src="playground.js"></script>

<script src="yourPlayground.js"></script>
<script src="exercises/converthourstoseconds.js"></script>
</body>

<div id="playground"></div>

<!-- https://github.com/CleverProgrammers/JavaScript-Course-by-Clever-Programmer- -->

<!DOCTYPE html>
<html>

<head>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Oswald&display=swap" rel="stylesheet">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">

<title>replit</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>


<body>
<h2>Official Github REPO (🌟 Go Star This ♥️)</h2>
<p>👉 <a href="https://github.com/CleverProgrammers/JavaScript-Course-by-Clever-Programmer-">JavaScript Course by Clever Programmer (Github Repo)</a></p>
<p>Let's get this trending 🚀</p>
<h3>Lessons</h3>
<a href="dom/red-yellow-green/index.html">DOM - Red Yellow Green Squares</a>
</br>
<a href="api/dogRandom/index.html">API - Get Random Dog</a>
</br>
<a href="api/superHero/index.html">API - Get Super Heroes</a></br>
<a href="classes/banksClass/index.html">Classes - Bank with Deposit & Withdraw Methods</a>

<h3>Project Exercises</h3>
<a href="functions/sum/exercise/index.html"> Sum </a> <br>
<a href='projects/stopwatch/exercise/index.html'>Stopwatch</a><br>
<a href='projects/rockpaperscissors/exercise/index.html'>Rock Paper Scissors</a><br>
<a href='projects/fightingGame/exercise/index.html'>Figthing Game</a> <br>
<a href='projects/tip-calculator/exercise/index.html'>Tip Calculator</a>
<br>
<a href='projects/weather-app/exercise/index.html'>Weather App</a>

<h3>Project Solutions</h3>
<a href='projects/stopwatch/solution/index.html'>Stopwatch</a><br>
<a href='projects/rockpaperscissors/solution/index.html'>Rock Paper Scissors</a><br>
<a href='projects/fightingGame/solution/index.html'>Fighting Game</a></br>
<a href='projects/tip-calculator/solution/index.html'>Tip Calculator</a>
<br>
<a href='projects/weather-app/solution/index.html'>Weather App</a>
</br>
<a href='projects/fetchmovies/solution/index.html'>Create Netflix</a>

<script src="https://cdnjs.cloudflare.com/ajax/libs/prettier/2.6.2/standalone.js"></script>
<script src="playground.js"></script>

<script src="yourPlayground.js"></script>
<script src="exercises/converthourstoseconds.js"></script>
</body>

</html>