From cf908553cdd8b8d5530eca8b537aa7870f1dd793 Mon Sep 17 00:00:00 2001 From: rasel-space01 Date: Sun, 8 Dec 2024 23:48:56 +0600 Subject: [PATCH] add increase count function --- 001-counter-app/Rasel/index.html | 33 +++++++ 001-counter-app/Rasel/script.js | 34 +++++++ 002-number-comparator/Alamin/index.html | 47 ---------- .../Alamin/number-comparator.js | 52 ----------- 002-number-comparator/Dipu/index.html | 28 ------ .../Dipu/number-comparator.js | 47 ---------- 002-number-comparator/Talha/index.html | 29 ------ .../Talha/number-comparator.js | 29 ------ 002-number-comparator/Tamjid/index.html | 28 ------ 002-number-comparator/Tamjid/script.js | 52 ----------- 002-number-comparator/bondodev/index.html | 28 ------ .../bondodev/number-comparator.js | 51 ----------- 002-number-comparator/nazma98/index.html | 29 ------ .../nazma98/number-comparator.js | 32 ------- .../sumiya-yasmin/index.html | 28 ------ .../sumiya-yasmin/number-comparator.js | 53 ----------- .../Alamin/grade-calculator.js | 82 ----------------- 003-grade-calculator/Alamin/index.html | 44 --------- 003-grade-calculator/Dipu/grade-calculator.js | 83 ----------------- 003-grade-calculator/Dipu/index.html | 26 ------ .../Talha/grade-calculator.js | 59 ------------ 003-grade-calculator/Talha/index.html | 29 ------ 003-grade-calculator/Tamjid/index.html | 29 ------ 003-grade-calculator/Tamjid/script.js | 91 ------------------- .../anikatasnim/grade-calculator.js | 58 ------------ 003-grade-calculator/anikatasnim/index.html | 31 ------- .../bongodev/grade-calculator.js | 0 003-grade-calculator/bongodev/index.html | 27 ------ .../nazma98/grade-calculator.js | 69 -------------- 003-grade-calculator/nazma98/index.html | 28 ------ .../promi/grade-calculator.js | 88 ------------------ 003-grade-calculator/promi/index.html | 28 ------ .../shobuz/grade_calculator.js | 62 ------------- 003-grade-calculator/shobuz/index.html | 44 --------- .../sumiya-yasmin/grade-calculator.js | 79 ---------------- 003-grade-calculator/sumiya-yasmin/index.html | 46 ---------- .../thanwin/grade-calculator.js | 57 ------------ 003-grade-calculator/thanwin/index.html | 30 ------ 004-number-table/Alamin/index.html | 37 -------- .../Alamin/multiplication-table-js | 54 ----------- 004-number-table/Dipu/index.html | 36 -------- 004-number-table/Dipu/script.js | 64 ------------- 004-number-table/Talha/index.html | 34 ------- .../Talha/multiplication-table.js | 76 ---------------- 004-number-table/Tamjid/index.html | 33 ------- 004-number-table/Tamjid/script.js | 65 ------------- 004-number-table/bongodev/index.html | 32 ------- .../bongodev/multiplication-table.js | 43 --------- 005-number-table-1-10/bongodev/index.html | 27 ------ .../bongodev/multiplication-table.js | 53 ----------- 50 files changed, 67 insertions(+), 2177 deletions(-) create mode 100644 001-counter-app/Rasel/index.html create mode 100644 001-counter-app/Rasel/script.js delete mode 100644 002-number-comparator/Alamin/index.html delete mode 100644 002-number-comparator/Alamin/number-comparator.js delete mode 100644 002-number-comparator/Dipu/index.html delete mode 100644 002-number-comparator/Dipu/number-comparator.js delete mode 100644 002-number-comparator/Talha/index.html delete mode 100644 002-number-comparator/Talha/number-comparator.js delete mode 100644 002-number-comparator/Tamjid/index.html delete mode 100644 002-number-comparator/Tamjid/script.js delete mode 100644 002-number-comparator/bondodev/index.html delete mode 100644 002-number-comparator/bondodev/number-comparator.js delete mode 100644 002-number-comparator/nazma98/index.html delete mode 100644 002-number-comparator/nazma98/number-comparator.js delete mode 100644 002-number-comparator/sumiya-yasmin/index.html delete mode 100644 002-number-comparator/sumiya-yasmin/number-comparator.js delete mode 100644 003-grade-calculator/Alamin/grade-calculator.js delete mode 100644 003-grade-calculator/Alamin/index.html delete mode 100644 003-grade-calculator/Dipu/grade-calculator.js delete mode 100644 003-grade-calculator/Dipu/index.html delete mode 100644 003-grade-calculator/Talha/grade-calculator.js delete mode 100644 003-grade-calculator/Talha/index.html delete mode 100644 003-grade-calculator/Tamjid/index.html delete mode 100644 003-grade-calculator/Tamjid/script.js delete mode 100644 003-grade-calculator/anikatasnim/grade-calculator.js delete mode 100644 003-grade-calculator/anikatasnim/index.html delete mode 100644 003-grade-calculator/bongodev/grade-calculator.js delete mode 100644 003-grade-calculator/bongodev/index.html delete mode 100644 003-grade-calculator/nazma98/grade-calculator.js delete mode 100644 003-grade-calculator/nazma98/index.html delete mode 100644 003-grade-calculator/promi/grade-calculator.js delete mode 100644 003-grade-calculator/promi/index.html delete mode 100644 003-grade-calculator/shobuz/grade_calculator.js delete mode 100644 003-grade-calculator/shobuz/index.html delete mode 100644 003-grade-calculator/sumiya-yasmin/grade-calculator.js delete mode 100644 003-grade-calculator/sumiya-yasmin/index.html delete mode 100644 003-grade-calculator/thanwin/grade-calculator.js delete mode 100644 003-grade-calculator/thanwin/index.html delete mode 100644 004-number-table/Alamin/index.html delete mode 100644 004-number-table/Alamin/multiplication-table-js delete mode 100644 004-number-table/Dipu/index.html delete mode 100644 004-number-table/Dipu/script.js delete mode 100644 004-number-table/Talha/index.html delete mode 100644 004-number-table/Talha/multiplication-table.js delete mode 100644 004-number-table/Tamjid/index.html delete mode 100644 004-number-table/Tamjid/script.js delete mode 100644 004-number-table/bongodev/index.html delete mode 100644 004-number-table/bongodev/multiplication-table.js delete mode 100644 005-number-table-1-10/bongodev/index.html delete mode 100644 005-number-table-1-10/bongodev/multiplication-table.js diff --git a/001-counter-app/Rasel/index.html b/001-counter-app/Rasel/index.html new file mode 100644 index 0000000..74828d7 --- /dev/null +++ b/001-counter-app/Rasel/index.html @@ -0,0 +1,33 @@ + + + + + + + Counter App + + + + + + + +
+

Counter App

+ + +
0
+ + +
+ + + +
+
+ + + + + \ No newline at end of file diff --git a/001-counter-app/Rasel/script.js b/001-counter-app/Rasel/script.js new file mode 100644 index 0000000..97691fe --- /dev/null +++ b/001-counter-app/Rasel/script.js @@ -0,0 +1,34 @@ +let count=0; +const counterElement=document.getElementById('counter'); +const incrementButton=document.getElementById('Increment'); +const resetButton=document.getElementById('reset'); +function increaseCount(){ + if(count ==10) + { + alert('Overflow'); + } + else{ + count=count+1; + counterElement.innerText=count; + } +} +incrementButton.addEventListener('click', increaseCount); +function decreaseCount() +{ + if(count==0) + { + alert('Count can not be negative'); + } + else{ + count=count-1; + counterElement.innerText=count; + } +} +function reset(){ + count=0; + counterElement.innerText=count; +} +resetButton.addEventListener('click',reset) + +const decrementButton=document.getElementById('decrement'); +decrementButton.addEventListener('click',decreaseCount ); \ No newline at end of file diff --git a/002-number-comparator/Alamin/index.html b/002-number-comparator/Alamin/index.html deleted file mode 100644 index 654c999..0000000 --- a/002-number-comparator/Alamin/index.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Number Comparator App - - - - - -
-

Number Comparator App

- -
- - -
- - - - -
-
- - - - - diff --git a/002-number-comparator/Alamin/number-comparator.js b/002-number-comparator/Alamin/number-comparator.js deleted file mode 100644 index a78d7b4..0000000 --- a/002-number-comparator/Alamin/number-comparator.js +++ /dev/null @@ -1,52 +0,0 @@ -const numberInput1 = document.getElementById('number1'); -const numberInput2 = document.getElementById('number2'); -const compareButton = document.getElementById('compare'); -const resetButton = document.getElementById('reset'); -const result = document.getElementById('result'); - -const ERROR_CLASS = 'border-red-500'; - -function resetErrorStyles() { - numberInput1.classList.remove(ERROR_CLASS); - numberInput2.classList.remove(ERROR_CLASS); -} - -function isValidInput() { - resetErrorStyles(); - - if (!numberInput1.value) { - numberInput1.classList.add(ERROR_CLASS); - return false; - } - if (!numberInput2.value) { - numberInput2.classList.add(ERROR_CLASS); - return false; - } - - return true; -} - -compareButton.addEventListener('click', function () { - if (!isValidInput()) { - alert("invalid input"); - return; - } - - const number1 = parseFloat(numberInput1.value); - const number2 = parseFloat(numberInput2.value); - - if (number1 > number2) { - result.innerText = 'First number is bigger'; - } else if (number1 < number2) { - result.innerText = 'Second number is bigger'; - } else { - result.innerText = 'Both numbers are equal'; - } -}); - -resetButton.addEventListener('click', function () { - numberInput1.value = '0'; - numberInput2.value = '0'; - result.innerText = ''; - resetErrorStyles(); -}); diff --git a/002-number-comparator/Dipu/index.html b/002-number-comparator/Dipu/index.html deleted file mode 100644 index 9fc11dd..0000000 --- a/002-number-comparator/Dipu/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - Number Comparator App - - - - - -
-

Number Comparator App

- -
- - -
- - - - -
-
- - - - \ No newline at end of file diff --git a/002-number-comparator/Dipu/number-comparator.js b/002-number-comparator/Dipu/number-comparator.js deleted file mode 100644 index b3fae16..0000000 --- a/002-number-comparator/Dipu/number-comparator.js +++ /dev/null @@ -1,47 +0,0 @@ -const inputNum1 = document.getElementById('number1'); -const inputnum2 = document.getElementById('number2'); -const comparatorButton = document.getElementById('compare'); -const result = document.getElementById('result'); -const Erro_Message = 'border-red-500'; -function ErrorStyle() { - inputNum1.classList.remove(Erro_Message); - inputnum2.classList.remove(Erro_Message); - return; - -} -function isvalidnumber() { - ErrorStyle(); - if (!inputNum1.value) { - inputNum1.classList.add(Erro_Message); - - return false; - } - if (!inputnum2.value) { - inputnum2.classList.add(Erro_Message); - return false; - } - return true; -} -comparatorButton.addEventListener('click', function () { - if (!isvalidnumber()) { - return; - } - const number1 = parseFloat(inputNum1.value); - const number2 = parseFloat(inputnum2.value); - if (number1 > number2) { - result.innerText = 'First number is Greater'; - } - else if (number1 < number2) { - result.innerText = 'Second Number is Greater'; - } - else { - result.innerText = 'Both are Equal'; - } -}); -const resetButton = document.getElementById('reset'); -resetButton.addEventListener('click', function () { - inputNum1.value = '0'; - inputnum2.value = '0'; - result.innerText = ' '; - ErrorStyle(); -}); \ No newline at end of file diff --git a/002-number-comparator/Talha/index.html b/002-number-comparator/Talha/index.html deleted file mode 100644 index e8d82a2..0000000 --- a/002-number-comparator/Talha/index.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - Number Comparator App - - - - - -
-

Number Comparator App

- -
- - -
- - - - - -
-
- - - - \ No newline at end of file diff --git a/002-number-comparator/Talha/number-comparator.js b/002-number-comparator/Talha/number-comparator.js deleted file mode 100644 index 7ea668e..0000000 --- a/002-number-comparator/Talha/number-comparator.js +++ /dev/null @@ -1,29 +0,0 @@ -const firstInput = document.getElementById("number1"); -const secondInput = document.getElementById("number2"); -const compareButton = document.getElementById("compare"); -const resultDiv = document.getElementById("result"); -const resetButton = document.getElementById("reset"); - -compareButton.addEventListener("click", function () { - let firstNum = parseFloat(firstInput.value); - let secondNum = parseFloat(secondInput.value); - - if (isNaN(firstNum) || isNaN(secondNum)) { - alert("Please enter valid numbers to compare!!!"); - resetFunction(); - } else if (firstNum > secondNum) { - resultDiv.textContent = firstNum + " is greater than " + secondNum; - } else if (firstNum < secondNum) { - resultDiv.textContent = firstNum + " is less than " + secondNum; - } else { - resultDiv.textContent = "Both numbers are equal"; - } -}); - -function resetFunction() { - firstInput.value = "0"; - secondInput.value = "0"; - resultDiv.textContent = ""; -} - -resetButton.addEventListener("click", resetFunction); diff --git a/002-number-comparator/Tamjid/index.html b/002-number-comparator/Tamjid/index.html deleted file mode 100644 index 71beca2..0000000 --- a/002-number-comparator/Tamjid/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - Number Comparator App - - - - - -
-

Number Comparator App

- -
- - -
- - - - -
-
- - - - \ No newline at end of file diff --git a/002-number-comparator/Tamjid/script.js b/002-number-comparator/Tamjid/script.js deleted file mode 100644 index a6480b6..0000000 --- a/002-number-comparator/Tamjid/script.js +++ /dev/null @@ -1,52 +0,0 @@ -const numberInput1 = document.getElementById('number1'); -const numberInput2 = document.getElementById('number2'); -const compareButton = document.getElementById('compare'); -const resetButton = document.getElementById('reset'); -const result = document.getElementById('result'); - -const ERROR_CLASS = 'border-red-500'; - -function resetErrorStyles() { - numberInput1.classList.remove(ERROR_CLASS); - numberInput2.classList.remove(ERROR_CLASS); -} - -function isValidInput() { - resetErrorStyles(); - - if (!numberInput1.value) { - numberInput1.classList.add(ERROR_CLASS); - return false; - } - if (!numberInput2.value) { - numberInput2.classList.add(ERROR_CLASS); - return false; - } - - return true; -} - -compareButton.addEventListener('click', function () { - if (!isValidInput()) { - alert('Please Enter Values First'); - return; - } - - const number1 = parseFloat(numberInput1.value); - const number2 = parseFloat(numberInput2.value); - - if (number1 > number2) { - result.innerText = 'First number is bigger'; - } else if (number1 < number2) { - result.innerText = 'Second number is bigger'; - } else { - result.innerText = 'Both numbers are equal'; - } -}); - -resetButton.addEventListener('click', function () { - numberInput1.value = '0'; - numberInput2.value = '0'; - result.innerText = ''; - resetErrorStyles(); -}); diff --git a/002-number-comparator/bondodev/index.html b/002-number-comparator/bondodev/index.html deleted file mode 100644 index c9744d2..0000000 --- a/002-number-comparator/bondodev/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - Number Comparator App - - - - - -
-

Number Comparator App

- -
- - -
- - - - -
-
- - - - \ No newline at end of file diff --git a/002-number-comparator/bondodev/number-comparator.js b/002-number-comparator/bondodev/number-comparator.js deleted file mode 100644 index 0dd1546..0000000 --- a/002-number-comparator/bondodev/number-comparator.js +++ /dev/null @@ -1,51 +0,0 @@ -const numberInput1 = document.getElementById('number1'); -const numberInput2 = document.getElementById('number2'); -const compareButton = document.getElementById('compare'); -const resetButton = document.getElementById('reset'); -const result = document.getElementById('result'); - -const ERROR_CLASS = 'border-red-500'; - -function resetErrorStyles() { - numberInput1.classList.remove(ERROR_CLASS); - numberInput2.classList.remove(ERROR_CLASS); -} - -function isValidInput() { - resetErrorStyles(); - - if (!numberInput1.value) { - numberInput1.classList.add(ERROR_CLASS); - return false; - } - if (!numberInput2.value) { - numberInput2.classList.add(ERROR_CLASS); - return false; - } - - return true; -} - -compareButton.addEventListener('click', function () { - if (!isValidInput()) { - return; - } - - const number1 = parseFloat(numberInput1.value); - const number2 = parseFloat(numberInput2.value); - - if (number1 > number2) { - result.innerText = 'First number is bigger'; - } else if (number1 < number2) { - result.innerText = 'Second number is bigger'; - } else { - result.innerText = 'Both numbers are equal'; - } -}); - -resetButton.addEventListener('click', function () { - numberInput1.value = '0'; - numberInput2.value = '0'; - result.innerText = ''; - resetErrorStyles(); -}); diff --git a/002-number-comparator/nazma98/index.html b/002-number-comparator/nazma98/index.html deleted file mode 100644 index 9a316ae..0000000 --- a/002-number-comparator/nazma98/index.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - Number Comparator App - - - - - -
-

Number Comparator App

- -
- - -
- - - -
- - -
- - - - diff --git a/002-number-comparator/nazma98/number-comparator.js b/002-number-comparator/nazma98/number-comparator.js deleted file mode 100644 index 1279278..0000000 --- a/002-number-comparator/nazma98/number-comparator.js +++ /dev/null @@ -1,32 +0,0 @@ -const number1Element = document.getElementById("number1"); -const number2Element = document.getElementById("number2"); -const resultElement = document.getElementById("result"); -const compareBtnElement = document.getElementById("compare"); -const resetBtnElement = document.getElementById("reset"); - -compareBtnElement.addEventListener('click', function () { - let number1 = parseFloat(number1Element.value); - let number2 = parseFloat(number2Element.value); - - if (isNaN(number1) || isNaN(number2)) { - alert("Please enter valid integer numbers!"); - resetInput(); - } else { - if (number1 === number2) { - resultElement.innerText = "Both numbers are equal!"; - } else if (number1 > number2) { - resultElement.innerText = "First number is greater than second number!"; - } else { - resultElement.innerText = "Second number is greater than first number!"; - } - } -}); - -function resetInput() { - number1Element.value = "0"; - number2Element.value = "0"; - resultElement.innerText = ""; -} - -resetBtnElement.addEventListener('click', resetInput); - diff --git a/002-number-comparator/sumiya-yasmin/index.html b/002-number-comparator/sumiya-yasmin/index.html deleted file mode 100644 index 81537d1..0000000 --- a/002-number-comparator/sumiya-yasmin/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - Number Comparator App - - - - - -
-

Number Comparator App

- -
- - -
- - - -
- -
- - - - diff --git a/002-number-comparator/sumiya-yasmin/number-comparator.js b/002-number-comparator/sumiya-yasmin/number-comparator.js deleted file mode 100644 index 8981cc2..0000000 --- a/002-number-comparator/sumiya-yasmin/number-comparator.js +++ /dev/null @@ -1,53 +0,0 @@ -const firstNumber = document.getElementById("number1"); -const secondNumber = document.getElementById("number2"); -const compareButton = document.getElementById("compare"); -const resultElement = document.getElementById("result"); -const resetButton = document.getElementById("reset"); -const ERROR_CLASS = "border-red-500"; -const ERROR_TEXT = "text-red-500"; -function resetErrorStyles() { - firstNumber.classList.remove(ERROR_CLASS); - secondNumber.classList.remove(ERROR_CLASS); - resultElement.classList.remove(ERROR_TEXT); -} -function isValidInput() { - resetErrorStyles(); - let isValid = true; - if (firstNumber.value === "") { - firstNumber.classList.add(ERROR_CLASS); - isValid = false; - } - if (!secondNumber.value) { - secondNumber.classList.add(ERROR_CLASS); - isValid = false; - } - return isValid; -} -compareButton.addEventListener("click", function () { - if (!isValidInput()) { - resultElement.innerText = "Please Enter a valid number"; - resultElement.classList.add(ERROR_TEXT); - return; - } - - if (Number(firstNumber.value) > Number(secondNumber.value)) { - resultElement.innerText = - Number(firstNumber.value) + - " is greater than " + - Number(secondNumber.value); - } else if (Number(firstNumber.value) === Number(secondNumber.value)) { - resultElement.innerText = "Both numbers are equal"; - } else { - resultElement.innerText = - Number(secondNumber.value) + - " is greater than " + - Number(firstNumber.value); - } -}); - -resetButton.addEventListener("click", function () { - firstNumber.value = 0; - secondNumber.value = 0; - resultElement.innerText = ""; - resetErrorStyles(); -}); diff --git a/003-grade-calculator/Alamin/grade-calculator.js b/003-grade-calculator/Alamin/grade-calculator.js deleted file mode 100644 index 20c6fe5..0000000 --- a/003-grade-calculator/Alamin/grade-calculator.js +++ /dev/null @@ -1,82 +0,0 @@ -const inputField = document.getElementById("score"); -const calculateBtn = document.getElementById("calculate-btn"); -const resultDisplay = document.getElementById("result"); -const resetBtn = document.getElementById("reset-btn"); -const errorMsg = document.getElementById("error-message"); - -function calculateGrade() { - let grade = ""; - let borderClass = ""; - let backgroundClass = ""; - if (inputField.value === "") { - errorMsg.innerText = "Please enter a valid score."; - errorMsg.classList.remove("hidden"); - errorMsg.classList.add("text-red-500", "mt-2"); - return; - } - const scoreValue = parseFloat(inputField.value); - - if (scoreValue < 0 || scoreValue > 100) { - errorMsg.innerText = "Score must be between 0 and 100."; - errorMsg.classList.remove("hidden"); - errorMsg.classList.add("text-red-500", "mt-2"); - return; - } else { - errorMsg.classList.add("hidden"); - } - if (scoreValue >= 80) { - grade = "A+"; - borderClass = "border-green-500"; - backgroundClass = "bg-green-100"; - } else if (scoreValue >= 75) { - grade = "A"; - borderClass = "border-green-400"; - backgroundClass = "bg-green-50"; - } else if (scoreValue >= 70) { - grade = "A-"; - borderClass = "border-green-300"; - backgroundClass = "bg-green-50"; - } else if (scoreValue >= 65) { - grade = "B+"; - borderClass = "border-blue-400"; - backgroundClass = "bg-blue-100"; - } else if (scoreValue >= 60) { - grade = "B"; - borderClass = "border-blue-300"; - backgroundClass = "bg-blue-50"; - } else if (scoreValue >= 55) { - grade = "B-"; - borderClass = "border-blue-200"; - backgroundClass = "bg-blue-50"; - } else if (scoreValue >= 50) { - grade = "C+"; - borderClass = "border-yellow-400"; - backgroundClass = "bg-yellow-100"; - } else if (scoreValue >= 45) { - grade = "C"; - borderClass = "border-yellow-300"; - backgroundClass = "bg-yellow-50"; - } else if (scoreValue >= 40) { - grade = "D"; - borderClass = "border-orange-400"; - backgroundClass = "bg-orange-100"; - } else { - grade = "F"; - borderClass = "border-red-500"; - backgroundClass = "bg-red-100"; - } - - resultDisplay.innerText = "Your Grade is " + grade; - resultDisplay.className = `mt-4 text-xl font-bold border-2 rounded-lg ${borderClass} ${backgroundClass}`; -} - -function clearFields() { - inputField.value = ""; - resultDisplay.innerText = ""; - errorMsg.innerText = ""; - errorMsg.classList.add("hidden"); - resultDisplay.className = "mt-4 text-xl font-bold"; -} - -calculateBtn.addEventListener("click", calculateGrade); -resetBtn.addEventListener("click", clearFields); diff --git a/003-grade-calculator/Alamin/index.html b/003-grade-calculator/Alamin/index.html deleted file mode 100644 index 891e468..0000000 --- a/003-grade-calculator/Alamin/index.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Grade Calculator - - - - - -
-

Grade Calculator

- - - - - - - - -
-
- - - - - diff --git a/003-grade-calculator/Dipu/grade-calculator.js b/003-grade-calculator/Dipu/grade-calculator.js deleted file mode 100644 index b47f20d..0000000 --- a/003-grade-calculator/Dipu/grade-calculator.js +++ /dev/null @@ -1,83 +0,0 @@ -const numberInput = document.getElementById('score'); -const calculatorButton = document.getElementById('calculate-btn'); -const result = document.getElementById('result'); - -calculatorButton.addEventListener('click', function () { - - if (isEmptyInput()) { - errormessge(); - result.innerText = 'Please enter valid marks'; - - return; - } - const number = parseFloat(numberInput.value); - if (isInvalid(number)) { - - result.innerText = 'Please enter valid marks'; - - return; - } - - const grade = calculateGrade(number); - result.innerText = grade; -}); -const ERROR_MESS = 'border-red-500'; -function errormessge() { - numberInput.classList.add(ERROR_MESS); - -} -function isEmptyInput() { - if (!numberInput.value) { - return true; - } - return false; - -} -function isInvalid(marks) { - if (marks > 100 || marks < 0) { - return true; - } - return false; -} - -function calculateGrade(marks) { - let grade = ' '; - if (marks > 100 || marks < 0) { - grade = 'Invalid Marks'; - } - else if (marks <= 100 && marks >= 80) { - grade = 'A+'; - } - else if (marks < 80 && marks >= 70) { - grade = 'A'; - } - else if (marks < 70 && marks >= 60) { - grade = 'A-'; - } - else if (marks < 60 && marks >= 50) { - grade = 'B'; - } - else if (marks < 50 && marks >= 40) { - grade = 'C'; - } - else if (marks < 40 && marks >= 33) { - grade = 'D'; - } - else { - grade = 'F'; - } - return grade; - - - -} -const resetButton = document.getElementById('reset'); -resetButton.addEventListener('click', function () { - numberInput.value = '0'; - result.innerText = ' '; - removeErrormessage(); - -}); -function removeErrormessage() { - numberInput.classList.remove(ERROR_MESS); -} diff --git a/003-grade-calculator/Dipu/index.html b/003-grade-calculator/Dipu/index.html deleted file mode 100644 index 4ef51ea..0000000 --- a/003-grade-calculator/Dipu/index.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - Grade Calculator - - - - - -
-

Grade Calculator

- - - - - - - -
-
- - - - \ No newline at end of file diff --git a/003-grade-calculator/Talha/grade-calculator.js b/003-grade-calculator/Talha/grade-calculator.js deleted file mode 100644 index a7bd194..0000000 --- a/003-grade-calculator/Talha/grade-calculator.js +++ /dev/null @@ -1,59 +0,0 @@ -const scoreInput = document.getElementById("score"); -const calculateGradeButton = document.getElementById("calculate-btn"); -const result = document.getElementById("result"); -const resetButton = document.getElementById("reset"); -const errorMessage = document.getElementById("error-message"); - -const ERROR_CLASS = "border-red-500"; - -function resetErrorStyles() { - scoreInput.classList.remove(ERROR_CLASS); - errorMessage.classList.add("hidden"); -} - -function isValidInput() { - resetErrorStyles(); - if (!scoreInput.value) { - scoreInput.classList.add(ERROR_CLASS); - errorMessage.classList.remove("hidden"); - errorMessage.textContent = "Please enter a valid score!!"; - return false; - } - if (scoreInput.value < 0 || scoreInput.value > 100) { - scoreInput.classList.add(ERROR_CLASS); - errorMessage.classList.remove("hidden"); - errorMessage.textContent = "Please enter score between 0 to 100!!"; - return false; - } - return true; -} - -calculateGradeButton.addEventListener("click", function () { - if (!isValidInput()) { - return; - } - - let score = parseFloat(scoreInput.value); - - if (score >= 0 && score < 33) { - result.textContent = "F"; - } else if (score >= 33 && score < 40) { - result.textContent = "D"; - } else if (score >= 40 && score < 50) { - result.textContent = "C"; - } else if (score >= 50 && score < 60) { - result.textContent = "B"; - } else if (score >= 60 && score < 70) { - result.textContent = "A-"; - } else if (score >= 70 && score < 80) { - result.textContent = "A"; - } else if (score >= 80 && score <= 100) { - result.textContent = "A+"; - } -}); - -resetButton.addEventListener("click", function () { - scoreInput.value = ""; - result.textContent = ""; - resetErrorStyles(); -}); diff --git a/003-grade-calculator/Talha/index.html b/003-grade-calculator/Talha/index.html deleted file mode 100644 index 6e441c5..0000000 --- a/003-grade-calculator/Talha/index.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - Grade Calculator - - - - - -
-

Grade Calculator

- - - - - - - - - -
-
- - - - \ No newline at end of file diff --git a/003-grade-calculator/Tamjid/index.html b/003-grade-calculator/Tamjid/index.html deleted file mode 100644 index b0b7c90..0000000 --- a/003-grade-calculator/Tamjid/index.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - Grade Calculator - - - - - -
-

Grade Calculator

- - - - - - - - - -
-
- - - - \ No newline at end of file diff --git a/003-grade-calculator/Tamjid/script.js b/003-grade-calculator/Tamjid/script.js deleted file mode 100644 index 9b2ec34..0000000 --- a/003-grade-calculator/Tamjid/script.js +++ /dev/null @@ -1,91 +0,0 @@ - -const inputButton = document.getElementById("score"); -const calculateButton = document.getElementById("calculate-btn"); -const resultButton = document.getElementById("result"); -const resetButton = document.getElementById("reset-btn"); -const errorButton = document.getElementById("error-message"); - -function result(){ - let grade = ""; - let borderColor = ""; - let bgColor = ""; - if(inputButton.value==""){ - errorButton.innerText="Please enter valid input"; - errorButton.classList.remove("hidden"); - return; - } -score=parseFloat(inputButton.value); -if(score<0 || score>100){ - errorButton.innerText="Please enter valid input"; - errorButton.classList.remove("hidden"); - return; -} -else{ - errorButton.classList.add("hidden"); -} - if (score >= 80) { - grade = "A+"; - borderColor = "border-green-500"; - bgColor = "bg-green-100"; - } - else if (score >= 75) { - grade = "A"; - borderColor = "border-green-400"; - bgColor = "bg-green-50"; - } - else if (score >= 70) { - grade = "A-"; - borderColor = "border-green-300"; - bgColor = "bg-green-50"; - } - else if (score >= 65) { - grade = "B+"; - borderColor = "border-blue-400"; - bgColor = "bg-blue-100"; - } - else if (score >= 60) { - grade = "B"; - borderColor = "border-blue-300"; - bgColor = "bg-blue-50"; - } - else if (score >= 55) { - grade = "B-"; - borderColor = "border-blue-200"; - bgColor = "bg-blue-50"; - } - else if (score >= 50) { - grade = "C+"; - borderColor = "border-yellow-400"; - bgColor = "bg-yellow-100"; - } - else if (score >= 45) { - grade = "C"; - borderColor = "border-yellow-300"; - bgColor = "bg-yellow-50"; - } - else if (score >= 40) { - grade = "D"; - borderColor = "border-orange-400"; - bgColor = "bg-orange-100"; - } - else { - grade = "F"; - borderColor = "border-red-500"; - bgColor = "bg-red-100"; - } -resultButton.innerText="Your Grade is "+grade; -resultButton.className = "mt-4 text-xl font-bold border-2 rounded-lg " + borderColor + " " + bgColor; - -} - -function reset(){ - inputButton.value = ""; - resultButton.innerText = ""; - errorButton.innerText = ""; - errorButton.classList.add("hidden"); - resultButton.className = "mt-4 text-xl font-bold"; -} - -calculateButton.addEventListener('click',result); -resetButton.addEventListener('click',reset); - diff --git a/003-grade-calculator/anikatasnim/grade-calculator.js b/003-grade-calculator/anikatasnim/grade-calculator.js deleted file mode 100644 index 05a4f64..0000000 --- a/003-grade-calculator/anikatasnim/grade-calculator.js +++ /dev/null @@ -1,58 +0,0 @@ -const scoreInput = document.getElementById('score') -const resultDiv = document.getElementById('result') -const calculateButton = document.getElementById('calculate') -const resetButton = document.getElementById('reset') -const errorMessage = document.getElementById('error-message') - - -calculateButton.addEventListener('click', function () { - let Score = parseFloat(scoreInput.value) - - errorMessage.innerText = "" - errorMessage.classList.add("hidden") - - if (isNaN(Score)) { - - errorMessage.innerText = "Please enter a valid number!" - errorMessage.classList.remove("hidden") - resultDiv.innerText = "" - return; - } - if (Score < 0 || Score > 100) { - errorMessage.innerText = "Score must be between 0 and 100" - errorMessage.classList.remove("hidden") - resultDiv.innerText = "" - return; - } - if (Score >= 80) { - resultDiv.innerText = "A+" - } - else if (Score >= 70) { - resultDiv.innerText = "A" - } - else if (Score >= 60) { - resultDiv.innerText = "A-" - } - else if (Score >= 50) { - resultDiv.innerText = "B" - } - else if (Score >= 40) { - resultDiv.innerText = "C" - } - else if (Score >= 33) { - resultDiv.innerText = "D" - } - else { - resultDiv.innerText = "F" - resultDiv.style.color = "red" - } - - -}) - -resetButton.addEventListener('click', function () { - scoreInput.value = "" - resultDiv.innerText = "" - errorMessage.innerText = "" - errorMessage.classList.add("hidden") -}) \ No newline at end of file diff --git a/003-grade-calculator/anikatasnim/index.html b/003-grade-calculator/anikatasnim/index.html deleted file mode 100644 index a0dd96a..0000000 --- a/003-grade-calculator/anikatasnim/index.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Grade Calculator - - - - - -
-

Grade Calculator

- -
- - -
- - - - - - -
-
- - - - diff --git a/003-grade-calculator/bongodev/grade-calculator.js b/003-grade-calculator/bongodev/grade-calculator.js deleted file mode 100644 index e69de29..0000000 diff --git a/003-grade-calculator/bongodev/index.html b/003-grade-calculator/bongodev/index.html deleted file mode 100644 index 4399176..0000000 --- a/003-grade-calculator/bongodev/index.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - Grade Calculator - - - - - -
-

Grade Calculator

- - - - - - - -
-
- - - - \ No newline at end of file diff --git a/003-grade-calculator/nazma98/grade-calculator.js b/003-grade-calculator/nazma98/grade-calculator.js deleted file mode 100644 index 772fb94..0000000 --- a/003-grade-calculator/nazma98/grade-calculator.js +++ /dev/null @@ -1,69 +0,0 @@ -const numberElement = document.getElementById("score"); -const calculateBtn = document.getElementById("calculate-btn"); -const result = document.getElementById("result"); -const errorMsg = document.getElementById("error-message"); -const resetBtn = document.getElementById("reset-btn"); - -const ERROR_CLASS = 'border-red-500'; -const FAIL_GRADE = 'text-red-700'; -const PASS_GRADE = 'text-green-600'; - -function resetErrorStyles(){ - numberElement.classList.remove(ERROR_CLASS); - result.classList.remove(FAIL_GRADE); - result.classList.remove(PASS_GRADE); -} - -function isValidMark() { - resetErrorStyles(); - - if (!numberElement.value) { - numberElement.classList.add(ERROR_CLASS); - return false; - } - - return true; - } - -function calculateGrade(){ - if(!isValidMark()){ - return; - } - - const marks = parseFloat(numberElement.value); - result.classList.add(PASS_GRADE); - if(marks >= 80 && marks <= 100){ - result.innerText = 'A+'; - } else if(marks >= 75 && marks < 80) { - result.innerText = 'A'; - } else if(marks >= 70 && marks < 75) { - result.innerText = 'A-'; - } else if(marks >= 65 && marks < 70) { - result.innerText = 'B+'; - } else if(marks >= 60 && marks < 65) { - result.innerText = 'B'; - } else if(marks >= 55 && marks < 60) { - result.innerText = 'B-'; - } else if(marks >= 50 && marks < 55) { - result.innerText = 'C+'; - } else if(marks >= 45 && marks < 50) { - result.innerText = 'C'; - } else if(marks >= 40 && marks < 45) { - result.innerText = 'D'; - } else if(marks < 40 && marks >= 0) { - result.classList.add(FAIL_GRADE); - result.innerText = 'F'; - } else { - errorMsg.classList.remove("hidden"); - errorMsg.innerText = "Please enter score 0-100!" - } -} - -calculateBtn.addEventListener("click", calculateGrade); - -resetBtn.addEventListener("click", function(){ - numberElement.value = ""; - result.innerText = ""; - errorMsg.innerText = ""; - resetErrorStyles(); -}); \ No newline at end of file diff --git a/003-grade-calculator/nazma98/index.html b/003-grade-calculator/nazma98/index.html deleted file mode 100644 index 8b57fac..0000000 --- a/003-grade-calculator/nazma98/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - Grade Calculator - - - - - -
-

Grade Calculator

- - - - - - - - -
-
- - - - \ No newline at end of file diff --git a/003-grade-calculator/promi/grade-calculator.js b/003-grade-calculator/promi/grade-calculator.js deleted file mode 100644 index 9f56ed1..0000000 --- a/003-grade-calculator/promi/grade-calculator.js +++ /dev/null @@ -1,88 +0,0 @@ -//Storing the input -const inputScore = document.getElementById("score"); -const calculatorBtn = document.getElementById("calculate-btn"); -const result = document.getElementById("result"); -const errorMsg = document.getElementById("error-message"); -const resetBtn = document.getElementById("reset-btn"); - -//Container for text color -const PASS_GRADE = "text-green-700"; -const ERROR_CLASS = "border-red-700"; -const FAIL_GRADE = "text-red-700"; - -//Set Error style -function setErrorStyles(message) { - inputScore.classList.add(ERROR_CLASS); - errorMsg.innerText = message; -} - -//reset Error style -function resetErrorStyles() { - inputScore.classList.remove(ERROR_CLASS); - result.classList.remove("hidden"); - - errorMsg.innerText = ""; -} - -//Checking if the input is empty or not -const isEmptyInput = () => { - return !inputScore.value ? true : false; -}; - -//Grade Calculate Event -function gradeCalculate(marks) { - result.classList.remove(FAIL_GRADE, PASS_GRADE); - if (marks > 100 || marks < 0) { - result.innerText = `Please enter a number between 0 and 100.`; - result.classList.add(FAIL_GRADE); - return; - } - result.classList.add(PASS_GRADE); - if (marks >= 80 && marks <= 100) { - result.innerText = "A+"; - } else if (marks >= 75 && marks < 80) { - result.innerText = "A"; - } else if (marks >= 70 && marks < 75) { - result.innerText = "A-"; - } else if (marks >= 65 && marks < 70) { - result.innerText = "B+"; - } else if (marks >= 60 && marks < 65) { - result.innerText = "B"; - } else if (marks >= 55 && marks < 60) { - result.innerText = "B-"; - } else if (marks >= 50 && marks < 55) { - result.innerText = "C+"; - } else if (marks >= 45 && marks < 50) { - result.innerText = "C"; - } else if (marks >= 40 && marks < 45) { - result.innerText = "D"; - } else if (marks < 40 && marks >= 0) { - result.classList.add(FAIL_GRADE); - result.innerText = "F"; - } else { - errorMsg.classList.remove("hidden"); - errorMsg.innerText = "Please enter score between 0 to 100 "; - } -} - -function MarksCalculate() { - resetErrorStyles(); - if (isEmptyInput()) { - setErrorStyles("Score cannot be empty."); - return; - } - const score = parseFloat(inputScore.value); - - gradeCalculate(score); -} - -// Calculate Button Event -calculatorBtn.addEventListener("click", MarksCalculate); - -//Reset Button Event -resetBtn.addEventListener("click", function () { - inputScore.value = ""; - result.innerText = ""; - errorMsg.innerText = ""; - resetErrorStyles(); -}); diff --git a/003-grade-calculator/promi/index.html b/003-grade-calculator/promi/index.html deleted file mode 100644 index b4c1adb..0000000 --- a/003-grade-calculator/promi/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - Grade Calculator - - - - - -
-

Grade Calculator

- - - - - - - - -
-
- - - - \ No newline at end of file diff --git a/003-grade-calculator/shobuz/grade_calculator.js b/003-grade-calculator/shobuz/grade_calculator.js deleted file mode 100644 index 7b03a4b..0000000 --- a/003-grade-calculator/shobuz/grade_calculator.js +++ /dev/null @@ -1,62 +0,0 @@ -const inputGradeMarks = document.getElementById("inputGrade"); -const marksCalculate = document.getElementById("calculator"); -const marksReset = document.getElementById("reset"); -const errorMessageShow = document.getElementById("errorMessage"); -const showResult = document.getElementById("result"); - -let error_class = "border-red-800"; - -function resetErrorStyles() { - inputGradeMarks.classList.remove(error_class); - errorMessageShow.classList.add("hidden"); -} - -function isValidInput() { - resetErrorStyles(); - if (!inputGradeMarks.value) { - inputGradeMarks.classList.add(error_class); - errorMessageShow.classList.remove("hidden"); - errorMessageShow.textContent = "plz enter a valid number"; - return false; - } - if (inputGradeMarks.value < 0 || inputGradeMarks.value > 100) { - inputGradeMarks.classList.add(error_class); - errorMessageShow.classList.remove("hidden"); - errorMessageShow.textContent = - "plz enter number that is above 0 but less than 101"; - return false; - } - return true; -} - -marksCalculate.addEventListener("click", function () { - if (!isValidInput()) { - return; - } - let score = parseFloat(inputGradeMarks.value); - - if (score > 0 && score < 33) { - showResult.textContent = "F"; - } else if (score >= 33 && score < 40) { - showResult.textContent = "D"; - } else if (score >= 40 && score < 50) { - showResult.textContent = "C"; - } else if (score >= 50 && score < 60) { - showResult.textContent = "B"; - } else if (score >= 60 && score < 70) { - showResult.textContent = "A-"; - } else if (score >= 70 && score < 80) { - showResult.textContent = "A"; - } else if (score >= 80 && score <= 100) { - showResult.textContent = "A+"; - } //else{ - // showResult.textContent="Invalid Number"; - //} -}); - -marksReset.addEventListener("click", function () { - inputGradeMarks.value = ""; - showResult.textContent = ""; - errorMessageShow.textContent = ""; - resetErrorStyles(); -}); diff --git a/003-grade-calculator/shobuz/index.html b/003-grade-calculator/shobuz/index.html deleted file mode 100644 index 18dce56..0000000 --- a/003-grade-calculator/shobuz/index.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - grade calculator - - - -
-

- Grade Calculator -

-
- -
-
-

-
-
- - -
-
-

-
-
- - - diff --git a/003-grade-calculator/sumiya-yasmin/grade-calculator.js b/003-grade-calculator/sumiya-yasmin/grade-calculator.js deleted file mode 100644 index f9179a8..0000000 --- a/003-grade-calculator/sumiya-yasmin/grade-calculator.js +++ /dev/null @@ -1,79 +0,0 @@ -const numberInput = document.getElementById("score"); -const errorAlert = document.getElementById("error-message"); -const calculateButton = document.getElementById("calculate-btn"); -const resultElement = document.getElementById("result"); -const resetButton = document.getElementById("reset-btn"); -const ERROR_CLASS = "border-red-500"; -const ERROR_TEXT = "text-red-600"; -const PASS_TEXT = "text-green-600"; -function resetErrorStyles() { - errorAlert.classList.add("hidden"); - resultElement.classList.add("hidden"); - numberInput.classList.remove(ERROR_CLASS); - resultElement.classList.remove(ERROR_TEXT); - resultElement.classList.remove(PASS_TEXT); -} -function isEmptyInput() { - if (!numberInput.value) { - return false; - } - return true; -} -function isValidInput() { - if (numberInput.value > 100 || numberInput.value < 0) { - return false; - } - return true; -} - -function calculateGrade() { - resetErrorStyles(); - let marks = Number(numberInput.value); - if (!isEmptyInput()) { - errorAlert.classList.remove("hidden"); - numberInput.classList.add(ERROR_CLASS); - errorAlert.classList.add(ERROR_TEXT); - errorAlert.innerText = "Your input is empty. Please Enter a Valid Number"; - return; - } - - if (!isValidInput()) { - errorAlert.classList.remove("hidden"); - numberInput.classList.add(ERROR_CLASS); - errorAlert.classList.add(ERROR_TEXT); - errorAlert.innerText = "Please Enter Number between 0-100"; - return; - } - resultElement.classList.remove("hidden"); - resultElement.classList.add(PASS_TEXT); - if (marks >= 90 && marks <= 100) { - resultElement.innerText = "A+"; - } else if (marks >= 85 && marks <= 89) { - resultElement.innerText = "A"; - } else if (marks >= 80 && marks <= 84) { - resultElement.innerText = "A-"; - } else if (marks >= 75 && marks <= 79) { - resultElement.innerText = "B+"; - } else if (marks >= 70 && marks <= 74) { - resultElement.innerText = "B"; - } else if (marks >= 65 && marks <= 69) { - resultElement.innerText = "B-"; - } else if (marks >= 60 && marks <= 64) { - resultElement.innerText = "C+"; - } else if (marks >= 50 && marks <= 59) { - resultElement.innerText = "C"; - } else if (marks >= 40 && marks <= 49) { - resultElement.innerText = "D"; - } else if (marks >= 0 && marks <= 39) { - resultElement.classList.remove(PASS_TEXT); - resultElement.classList.add(ERROR_TEXT); - resultElement.innerText = "F"; - } -} -calculateButton.addEventListener("click", calculateGrade); -resetButton.addEventListener("click", function () { - numberInput.value = ""; - resultElement.innerText = ""; - errorAlert.innerText = ""; - resetErrorStyles(); -}); diff --git a/003-grade-calculator/sumiya-yasmin/index.html b/003-grade-calculator/sumiya-yasmin/index.html deleted file mode 100644 index 8b4b7a9..0000000 --- a/003-grade-calculator/sumiya-yasmin/index.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Grade Calculator - - - - - -
-

Grade Calculator

- - -

- - - - -
- -
- - - - - diff --git a/003-grade-calculator/thanwin/grade-calculator.js b/003-grade-calculator/thanwin/grade-calculator.js deleted file mode 100644 index 0febd3b..0000000 --- a/003-grade-calculator/thanwin/grade-calculator.js +++ /dev/null @@ -1,57 +0,0 @@ -const score = document.getElementById("score"); -const errorMessage = document.getElementById("error-message"); -const calculateBtn = document.querySelector("#calculate-btn"); -const result = document.getElementById("result"); -const resetBtn = document.getElementById("reset-btn"); - - - - -calculateBtn.addEventListener("click", function(){ - const value = score.value - const grade = calculateGrade(value) - - if (!value){ - result.textContent = "Please enter a score" - return - } - if (grade.includes('Not')){ - result.textContent = "Please enter a valid score." - score.classList.add('border-2', 'border-red-300', "focus:outline-none", "focus:border-red-400") - - } - else { - score.classList.remove('border-2', 'border-red-300', "focus:outline-none", "focus:border-red-400") - result.textContent = `Your grade is ${grade}` - } - -}) - -resetBtn.addEventListener("click", function(){ - reset() -}) - -function reset(){ - score.classList.remove('border-2', 'border-red-300', "focus:outline-none", "focus:border-red-400") - score.value = "" - result.textContent = "" -} - -function calculateGrade(marks){ - if (marks >= 90 && marks <= 100){ - return 'A' - } - else if (marks >= 80 && marks <= 89){ - return 'B' - } - else if (marks >= 70 && marks <= 79){ - return 'C' - } - else if (marks >= 60 && marks <= 69){ - return 'D' - } else if (marks >= 0 && marks <= 59){ - return 'F' - } else { - return 'Not Valid Score' - } -} \ No newline at end of file diff --git a/003-grade-calculator/thanwin/index.html b/003-grade-calculator/thanwin/index.html deleted file mode 100644 index 7882284..0000000 --- a/003-grade-calculator/thanwin/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Grade Calculator - - - - - -
-

Grade Calculator

- - - - -
- - - -
- -
-
- - - - \ No newline at end of file diff --git a/004-number-table/Alamin/index.html b/004-number-table/Alamin/index.html deleted file mode 100644 index 0fc9ff4..0000000 --- a/004-number-table/Alamin/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Multiplication Table Generator - - - - - -
-

Multiplication Table Generator

- - - - - - - - -
- - - -
-
-
- - - - diff --git a/004-number-table/Alamin/multiplication-table-js b/004-number-table/Alamin/multiplication-table-js deleted file mode 100644 index bdf5110..0000000 --- a/004-number-table/Alamin/multiplication-table-js +++ /dev/null @@ -1,54 +0,0 @@ -const numberInput = document.getElementById("input-number"); -const generateBtn = document.getElementById("generate"); -const resetBtn = document.getElementById("reset-btn"); -const tableBody = document.getElementById("table-body"); - -generateBtn.addEventListener("click", function () { - const num = parseInt(numberInput.value); - - cleanTable(); - generateTable(num); -}); - -resetBtn.addEventListener("click", function () { - resetInputs(); -}); - -function cleanTable() { - tableBody.innerHTML = ""; -} - -function generateTable(num) { - for (let rowNo = 1; rowNo <= 10; rowNo++) { - const tableRow = generateRow(num, rowNo); - tableBody.appendChild(tableRow); - } -} - -function generateRow(num, rowNo) { - const cells = []; - for (let i = 1; i <= 5; i++) { - const cell = document.createElement("td"); - cells.push(cell); - } - - cells[0].innerText = num; - cells[1].innerText = " x "; - cells[2].innerText = rowNo; - cells[3].innerText = " = "; - cells[4].innerText = num * rowNo; - - const tableRow = document.createElement("tr"); - - for (let i = 0; i < cells.length; i++) { - tableRow.appendChild(cells[i]); - } - - return tableRow; -} - -function resetInputs() { - numberInput.value = "1"; - - cleanTable(); -} diff --git a/004-number-table/Dipu/index.html b/004-number-table/Dipu/index.html deleted file mode 100644 index 455f81c..0000000 --- a/004-number-table/Dipu/index.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - Multiplication Table Generator - - - - - -
-

Multiplication Table Generator

- - - - - - - - - - -
- - - - -
-
-
- - - - \ No newline at end of file diff --git a/004-number-table/Dipu/script.js b/004-number-table/Dipu/script.js deleted file mode 100644 index 49d7264..0000000 --- a/004-number-table/Dipu/script.js +++ /dev/null @@ -1,64 +0,0 @@ -const tableBody = document.getElementById('table-body'); -const generateButton = document.getElementById('generate'); -const number = document.getElementById('input-number'); -const ERR='border-red-500'; -function errormessage(){ - number.classList.add(ERR); -} - -function isInvalid(){ - if(!number.value){ - errormessage(); - return true; - } - else{ - return false; - } -} -generateButton.addEventListener('click', function () { - const num = parseInt(number.value); - if(isInvalid()) - { - return; - } - tableGenerate(num); - -}); -const resetButton=document.getElementById('reset'); -resetButton.addEventListener('click',function(){ - cleanTable(); - number.classList.remove(ERR); -}) -function cleanTable() { - tableBody.innerHTML = ' '; -} -function tableGenerate(num) { - for (let i = 1; i <= 10; i++) { - const tableRow = generateRow(num, i); - tableBody.appendChild(tableRow); - } - -} -function generateRow(num, mult) { - const cells = []; - for (let i = 1; i <= 5; i++) { - const cell = document.createElement('td'); - cells.push(cell); - } - - cells[0].innerText = num; - cells[1].innerText = 'x'; - cells[2].innerText = mult; - cells[3].innerText = '='; - cells[4].innerText = num * mult; - const tableRow = document.createElement('tr'); - for (let i = 0; i < cells.length; i++) { - - tableRow.appendChild(cells[i]); - } - - return tableRow; -} - - - diff --git a/004-number-table/Talha/index.html b/004-number-table/Talha/index.html deleted file mode 100644 index 85adf77..0000000 --- a/004-number-table/Talha/index.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - Multiplication Table Generator - - - - - -
-

Multiplication Table Generator

- - - - - - - - - -
- - - -
-
-
- - - - \ No newline at end of file diff --git a/004-number-table/Talha/multiplication-table.js b/004-number-table/Talha/multiplication-table.js deleted file mode 100644 index 2a56276..0000000 --- a/004-number-table/Talha/multiplication-table.js +++ /dev/null @@ -1,76 +0,0 @@ -const numberInput = document.getElementById("input-number"); -const generateBtn = document.getElementById("generate"); -const tableBody = document.getElementById("table-body"); -const resetBtn = document.getElementById("reset"); -const errorMsg = document.getElementById("error-message"); - -function resetErrorStyles() { - numberInput.classList.remove("border-red-500"); - errorMsg.classList.add("hidden"); -} - -function isValidInput() { - resetErrorStyles(); - if (!numberInput.value) { - numberInput.classList.add("border-red-500"); - errorMsg.classList.remove("hidden"); - errorMsg.textContent = "Please enter a valid number!!"; - return false; - } - if (numberInput.value < 0) { - numberInput.classList.add("border-red-500"); - errorMsg.classList.remove("hidden"); - errorMsg.textContent = "Please enter a positive number!!"; - return false; - } - return true; -} - -generateBtn.addEventListener("click", function () { - if (!isValidInput()) { - return; - } - const num = parseInt(numberInput.value); - - cleanTable(); - generateTable(num); -}); - -function cleanTable() { - tableBody.innerHTML = ""; -} - -function generateTable(num) { - for (let rowNo = 1; rowNo <= 10; rowNo++) { - const tableRow = generateRow(num, rowNo); - tableBody.appendChild(tableRow); - } -} - -function generateRow(num, rowNo) { - const cells = []; - for (let i = 1; i <= 5; i++) { - const cell = document.createElement("td"); - cells.push(cell); - } - - cells[0].innerText = num; - cells[1].innerText = " X "; - cells[2].innerText = rowNo; - cells[3].innerText = " = "; - cells[4].innerText = num * rowNo; - - const tableRow = document.createElement("tr"); - - for (let i = 0; i < cells.length; i++) { - tableRow.appendChild(cells[i]); - } - - return tableRow; -} - -resetBtn.addEventListener("click", function () { - numberInput.value = "1"; - cleanTable(); - resetErrorStyles(); -}); diff --git a/004-number-table/Tamjid/index.html b/004-number-table/Tamjid/index.html deleted file mode 100644 index 860f892..0000000 --- a/004-number-table/Tamjid/index.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - Multiplication Table Generator - - - - - -
-

Multiplication Table Generator

- - - - - - - - - -
- - - -
-
-
- - - - \ No newline at end of file diff --git a/004-number-table/Tamjid/script.js b/004-number-table/Tamjid/script.js deleted file mode 100644 index 65adbdf..0000000 --- a/004-number-table/Tamjid/script.js +++ /dev/null @@ -1,65 +0,0 @@ -const numberInput = document.getElementById("input-number"); -const generateBtn = document.getElementById("generate"); -const tableBody = document.getElementById("table-body"); -const errorMessage = document.getElementById("error-message"); -const resetButton = document.getElementById("reset-btn"); - -generateBtn.addEventListener("click", function () { - if (numberInput.value == "" || numberInput.value<0) { - errorMessage.innerText = "Please enter valid input"; - errorMessage.classList.remove("hidden"); - numberInput.classList.add("border-red-500", "bg-red-100"); - return; - } - const num = parseInt(numberInput.value); - numberInput.classList.remove("border-red-500", "bg-red-100"); - errorMessage.classList.add("hidden"); - cleanTable(); - generateTable(num); -}); - -function cleanTable() { - tableBody.innerHTML = ""; -} - -function generateTable(num) { - for (let rowNo = 1; rowNo <= 10; rowNo++) { - const tableRow = generateRow(num, rowNo); - if (rowNo % 2 === 0) { - tableRow.style.backgroundColor = "#a8a8a8"; - } else { - tableRow.style.backgroundColor = "#f0f0f0"; - } - - tableBody.appendChild(tableRow); - } -} - -function generateRow(num, rowNo) { - const cells = []; - for (let i = 1; i <= 5; i++) { - const cell = document.createElement("td"); - cells.push(cell); - } - - cells[0].innerText = num; - cells[1].innerText = " x "; - cells[2].innerText = rowNo; - cells[3].innerText = " = "; - cells[4].innerText = num * rowNo; - - const tableRow = document.createElement("tr"); - - for (let i = 0; i < cells.length; i++) { - tableRow.appendChild(cells[i]); - } - - return tableRow; -} -resetButton.addEventListener("click", function () { - numberInput.value = ""; - cleanTable(); - errorMessage.innerText = ""; - errorMessage.classList.add("hidden"); - numberInput.classList.remove("border-red-500", "bg-red-100"); -}); diff --git a/004-number-table/bongodev/index.html b/004-number-table/bongodev/index.html deleted file mode 100644 index 6533c28..0000000 --- a/004-number-table/bongodev/index.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - Multiplication Table Generator - - - - - -
-

Multiplication Table Generator

- - - - - - - - -
- - - -
-
-
- - - - \ No newline at end of file diff --git a/004-number-table/bongodev/multiplication-table.js b/004-number-table/bongodev/multiplication-table.js deleted file mode 100644 index ea33563..0000000 --- a/004-number-table/bongodev/multiplication-table.js +++ /dev/null @@ -1,43 +0,0 @@ -const numberInput = document.getElementById('input-number'); -const generateBtn = document.getElementById('generate'); -const tableBody = document.getElementById('table-body'); - -generateBtn.addEventListener('click', function () { - const num = parseInt(numberInput.value); - - cleanTable(); - generateTable(num); -}); - -function cleanTable() { - tableBody.innerHTML = ''; -} - -function generateTable(num) { - for (let rowNo = 1; rowNo <= 10; rowNo++) { - const tableRow = generateRow(num, rowNo); - tableBody.appendChild(tableRow); - } -} - -function generateRow(num, rowNo) { - const cells = []; - for (let i = 1; i <= 5; i++) { - const cell = document.createElement('td'); - cells.push(cell); - } - - cells[0].innerText = num; - cells[1].innerText = ' x '; - cells[2].innerText = rowNo; - cells[3].innerText = ' = '; - cells[4].innerText = num * rowNo; - - const tableRow = document.createElement('tr'); - - for (let i = 0; i < cells.length; i++) { - tableRow.appendChild(cells[i]); - } - - return tableRow; -} diff --git a/005-number-table-1-10/bongodev/index.html b/005-number-table-1-10/bongodev/index.html deleted file mode 100644 index 0b8f40e..0000000 --- a/005-number-table-1-10/bongodev/index.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - Multiplication Table Generator - - - - - -
-

Multiplication Table Generator

- - - - - -
-
-
-
-
- - - - diff --git a/005-number-table-1-10/bongodev/multiplication-table.js b/005-number-table-1-10/bongodev/multiplication-table.js deleted file mode 100644 index 10cea7c..0000000 --- a/005-number-table-1-10/bongodev/multiplication-table.js +++ /dev/null @@ -1,53 +0,0 @@ -const tableContainerTopRow = document.getElementById('top-row'); -const tableContainerBottomRow = document.getElementById('bottom-row'); -const generateBtn = document.getElementById('generate'); - -generateBtn.addEventListener('click', function () { - for (let num = 1; num <= 10; num++) { - const numberTable = getTable(num); - - if (num <= 5) { - tableContainerTopRow.appendChild(numberTable); - } else { - tableContainerBottomRow.appendChild(numberTable); - } - } -}); - -function getTable(num) { - const numberTable = document.createElement('table'); - numberTable.className = 'table-auto border border-slate-700 w-full'; - - const tableBody = document.createElement('tbody'); - - for (let row = 1; row <= 10; row++) { - const tableRow = getTableRow(num, row); - tableBody.appendChild(tableRow); - } - - numberTable.appendChild(tableBody); - - return numberTable; -} - -function getTableRow(num, row) { - const cells = []; - for (let cellNo = 0; cellNo < 5; cellNo++) { - const cell = document.createElement('td'); - cells.push(cell); - } - - cells[0].innerText = num; - cells[1].innerText = ' x '; - cells[2].innerText = row; - cells[3].innerText = ' = '; - cells[4].innerText = num * row; - - const tableRow = document.createElement('tr'); - - for (let cellNo = 0; cellNo < cells.length; cellNo++) { - tableRow.appendChild(cells[cellNo]); - } - - return tableRow; -}