Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

003 grade calculator app #79

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
33 changes: 33 additions & 0 deletions 001-counter-app/Rasel/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Counter App</title>
<!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
</head>

<body class="bg-gray-100 flex items-center justify-center min-h-screen">

<!-- Counter App Container -->
<div class="bg-white shadow-lg rounded-lg p-8 text-center">
<h1 class="text-2xl font-bold text-gray-800 mb-4">Counter App</h1>

<!-- Counter Display -->
<div id="counter" class="text-4xl font-bold text-gray-700">0</div>

<!-- Counter Controls -->
<div class="mt-6">
<button id="Increment"
class="bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded mr-2">+</button>
<button id="decrement" class="bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-4 rounded ml-2">-</button>
<button id="reset" class="bg-green-500 hover:bg-red-600 text-white flex-col font-bold py-2 px-4 rounded ml-2">Reset</button>
</div>
</div>

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

</html>
34 changes: 34 additions & 0 deletions 001-counter-app/Rasel/script.js
Original file line number Diff line number Diff line change
@@ -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 );
29 changes: 29 additions & 0 deletions 002-number-comparator/Rasel/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Number Comparator App</title>
<!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
</head>

<body class="bg-gray-100 h-screen flex items-center justify-center">
<div class="bg-white p-6 rounded-lg shadow-lg text-center">
<h1 class="text-2xl font-bold mb-4">Number Comparator App</h1>
<!-- Input Fields for Numbers -->
<div class="flex flex-col gap-4">
<input type="number" id="number1" placeholder="Enter first number" class="border p-2 rounded" value="0" />
<input type="number" id="number2" placeholder="Enter second number" class="border p-2 rounded" value="0" />
</div>
<!-- Button to Compare Numbers -->
<button id="compare" class="mt-4 bg-blue-500 text-white py-2 px-4 rounded">Compare</button>
<!-- Button to reset document -->
<button id="reset" class="mt-4 ms-6 bg-violet-500 text-white py-2 px-4 rounded">Reset</button>
<!-- Display Result -->
<div id="result" class="mt-4 text-xl font-bold"></div>
</div>

<!-- Include JavaScript -->
<script src="number-comparator.js"></script>
</body>
29 changes: 29 additions & 0 deletions 002-number-comparator/Rasel/number-comparator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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);
82 changes: 0 additions & 82 deletions 003-grade-calculator/Alamin/grade-calculator.js

This file was deleted.

44 changes: 0 additions & 44 deletions 003-grade-calculator/Alamin/index.html

This file was deleted.

83 changes: 0 additions & 83 deletions 003-grade-calculator/Dipu/grade-calculator.js

This file was deleted.

26 changes: 0 additions & 26 deletions 003-grade-calculator/Dipu/index.html

This file was deleted.

Loading