This calculator helps you estimate your fish catch rate based on the number of fish caught and the total fishing time. A higher catch rate generally indicates more successful fishing trips.
function calculateCatchRate() {
var fishCaughtInput = document.getElementById("fishCaught");
var fishingHoursInput = document.getElementById("fishingHours");
var resultDiv = document.getElementById("result");
var fishCaught = parseFloat(fishCaughtInput.value);
var fishingHours = parseFloat(fishingHoursInput.value);
if (isNaN(fishCaught) || isNaN(fishingHours)) {
resultDiv.innerHTML = "Please enter valid numbers for both fields.";
return;
}
if (fishingHours <= 0) {
resultDiv.innerHTML = "Fishing time must be greater than zero.";
return;
}
var catchRate = fishCaught / fishingHours;
resultDiv.innerHTML = "