Calculator Tools Calculator Tools
Create

Machine Rental Price Calculator

Dec 31, 2023

About this app

Calculate the price of machines if rented for a month, 1 or 2 years.

Machine Rental Price Calculator Machine Rental Price Calculator Number of Machines: Number of Months: Calculate Rental Price: $ 1 Year Price: $ 2 Years Price: $ 10% of Machine Price: $

Related apps

Put this on your site

Source

                    <html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">

<title>Machine Rental Price Calculator</title>
<meta name="description" content="Calculate the price of machines if rented for a month, 1 or 2 years.">
<meta name="keywords" content="machine rental, price calculator">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.
document.addEventListener("DOMContentLoaded", function() {
$("#calculateBtn").click(function() {
var numberOfMachines = parseInt($("#numberOfMachines").val());
var numberOfMonths = parseInt($("#numberOfMonths").val());
var machinePrice = 10000;
var rentalPrice = numberOfMachines * machinePrice * numberOfMonths / 100;

$("#rentalPrice").text(rentalPrice.toFixed(2));

var oneYearPrice = numberOfMachines * machinePrice * 12 / 100;
var twoYearsPrice = numberOfMachines * machinePrice * 24 / 100;

$("#oneYearPrice").text(oneYearPrice.toFixed(2));
$("#twoYearsPrice").text(twoYearsPrice.toFixed(2));

var tenPercentPrice = numberOfMachines * machinePrice * 10 / 100;
$("#tenPercentPrice").text(tenPercentPrice.toFixed(2));
});
});

} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>

<style>
.container {
max-width: 600px;
margin: 0 auto;
padding: 20px;
text-align: center;
background-color: #f8f9fa;
border-radius: 5px;
}
h1 {
margin-bottom: 20px;
}
.form-group {
margin-bottom: 20px;
}
label {
font-weight: bold;
}
.btn {
margin-top: 20px;
}
.output {
margin-top: 20px;
font-weight: bold;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1>Machine Rental Price Calculator</h1>
<div class="form-group">
<label for="numberOfMachines">Number of Machines:</label>
<input type="number" id="numberOfMachines" class="form-control">
</div>
<div class="form-group">
<label for="numberOfMonths">Number of Months:</label>
<input type="number" id="numberOfMonths" class="form-control">
</div>
<button id="calculateBtn" class="btn btn-primary">Calculate</button>
<div class="output">
<p>Rental Price: $<span id="rentalPrice"></span></p>
<p>1 Year Price: $<span id="oneYearPrice"></span></p>
<p>2 Years Price: $<span id="twoYearsPrice"></span></p>
<p>10% of Machine Price: $<span id="tenPercentPrice"></span></p>
</div>
</div>
</body>
</html>