diff --git a/Calculators/T-Score-Calculator/README.md b/Calculators/T-Score-Calculator/README.md new file mode 100644 index 000000000..f2185f6c2 --- /dev/null +++ b/Calculators/T-Score-Calculator/README.md @@ -0,0 +1,15 @@ +#

T-Score Calculator

+ +## Description :- + +A T-score calculator is a simple tool that allows individuals to calculate the T-score, which is used in hypothesis testing to determine if there is a significant difference between the sample mean and the population mean. + +## Tech Stacks :- + +- HTML +- CSS +- JavaScript + +## Screenshots :- + +![image](https://github.com/Rakesh9100/CalcDiverse/assets/73993775/87e3a2da-11f6-4939-88bb-7c83c33d0bed) diff --git a/Calculators/T-Score-Calculator/index.html b/Calculators/T-Score-Calculator/index.html new file mode 100644 index 000000000..2c03e95f6 --- /dev/null +++ b/Calculators/T-Score-Calculator/index.html @@ -0,0 +1,27 @@ + + + + + + + T-Score Calculator + + +
+

T-score Calculator

+
+ + + + + + + + + +
+
+
+ + + diff --git a/Calculators/T-Score-Calculator/script.js b/Calculators/T-Score-Calculator/script.js new file mode 100644 index 000000000..c33a1237b --- /dev/null +++ b/Calculators/T-Score-Calculator/script.js @@ -0,0 +1,23 @@ +function calculateTScore() { + const sampleMean = parseFloat(document.getElementById("sampleMean").value); + const populationMean = parseFloat( + document.getElementById("populationMean").value + ); + const sampleSD = parseFloat(document.getElementById("sampleSD").value); + const sampleSize = parseInt(document.getElementById("sampleSize").value); + + if ( + isNaN(sampleMean) || + isNaN(populationMean) || + isNaN(sampleSD) || + isNaN(sampleSize) + ) { + document.getElementById("result").innerText = "Please enter valid numbers"; + return; + } + + const tScore = + (sampleMean - populationMean) / (sampleSD / Math.sqrt(sampleSize)); + + document.getElementById("result").innerText = `T-score: ${tScore.toFixed(2)}`; +} diff --git a/Calculators/T-Score-Calculator/style.css b/Calculators/T-Score-Calculator/style.css new file mode 100644 index 000000000..ac7e1599d --- /dev/null +++ b/Calculators/T-Score-Calculator/style.css @@ -0,0 +1,79 @@ +body { + background-image: url("https://media.istockphoto.com/id/1407983911/photo/forex-diagrams-and-stock-market-rising-lines-with-numbers.jpg?s=612x612&w=0&k=20&c=zas1h6LR6v2iCvE7SWnVoZ_s7ZSiboN45UK0d5oMWac="); + background-size: cover; + background-position: center; + background-repeat: no-repeat; + font-family: Arial, sans-serif; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; + background-color: #f4f4f4; +} + +.calculator { + background: rgba(195, 241, 251, 0.6); + padding: 45px; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + width: 300px; +} + +h1 { + font-size: 24px; + color: rgb(250, 251, 255); + margin-bottom: 18px; + text-align: center; + font-size: 30px; +} + +label { + text-align: center; + display: block; + margin-bottom: 8px; + font-weight: bold; + color: #131616; + font-size: 20px; +} + +form { + display: flex; + flex-direction: column; + align-items: center; +} + +input { + text-align: center; + width: 100%; + padding: 8px; + margin-bottom: 25px; + border: 1px solid #4c8080; + border-radius: 7px; + font-size: 20px; +} + +input:hover { + border: 3px solid #070a0a; +} + +button { + width: 70%; + padding: 10px; + background: #4e9ff6; + color: #090808; + border: 2px solid #070a0a; + border-radius: 6px; + cursor: pointer; + font-size: 16px; +} + +button:hover { + background: linear-gradient(rgb(91, 91, 147), rgb(86, 86, 245)); +} + +#result { + margin-top: 30px; + font-size: 24px; + text-align: center; +} diff --git a/index.html b/index.html index 32e27c7d0..772ece92d 100644 --- a/index.html +++ b/index.html @@ -3562,6 +3562,20 @@

Calculator that gives an idea of the returns on their mutual fund investment +
+
+

T-Score Calculator

+

Calculates the T-score to test for significant differences between the sample mean and the population mean.

+ +
+

Taxi Fare Calculator