This calculator helps you estimate the potential earnings on a Certificate of Deposit (CD) with Chase Bank based on their current rates. Certificates of Deposit are a type of savings account with a fixed interest rate and a fixed term. You deposit money for a set period, and in return, the bank pays you interest. CDs can be a good option for saving money you don't need immediate access to, as they often offer higher interest rates than traditional savings accounts.
function calculateCDEarnings() {
var principal = parseFloat(document.getElementById("principal").value);
var annualRate = parseFloat(document.getElementById("annualRate").value) / 100; // Convert percentage to decimal
var termYears = parseFloat(document.getElementById("termYears").value);
var resultDiv = document.getElementById("result");
if (isNaN(principal) || isNaN(annualRate) || isNaN(termYears) || principal <= 0 || annualRate < 0 || termYears <= 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
// Using the compound interest formula: A = P(1 + r/n)^(nt)
// For CDs, interest is typically compounded annually. So n = 1.
// A = P(1 + r)^t
var totalAmount = principal * Math.pow((1 + annualRate), termYears);
var totalInterestEarned = totalAmount – principal;
resultDiv.innerHTML =
"Estimated Total Amount: $" + totalAmount.toFixed(2) + "" +
"Estimated Interest Earned: $" + totalInterestEarned.toFixed(2) + "";
}
#cd-calculator {
font-family: sans-serif;
max-width: 500px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
.form-group input {
width: calc(100% – 12px);
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
background-color: #007bff;
color: white;
padding: 10px 15px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
}
button:hover {
background-color: #0056b3;
}
#result p {
margin-top: 10px;
font-size: 1.1em;
}