Calculator Tools Calculator Tools
Create

Machine Rental Price Calculator

Dec 31, 2023

About this app

Calculate the price of machines if rented for a specific number of months

Machine Rental Price Calculator Machine Rental Price Calculator Number of Machines: Number of Months: Calculate

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 specific number of months">
<meta name="keywords" content="machine rental, price calculator, commission">

<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.

// This will run when the DOM is ready.
document.addEventListener("DOMContentLoaded", function() {
// Get the input fields
var machinesInput = document.getElementById('machines');
var monthsInput = document.getElementById('months');
var calculateButton = document.getElementById('calculate');
var resultContainer = document.getElementById('result-container');

// Add event listener to the calculate button
calculateButton.addEventListener('click', function() {
// Get the input values
var machines = parseInt(machinesInput.value);
var months = parseInt(monthsInput.value);

// Calculate the price and commission
var price = (machines * 10000 * months) / 100;
var commission = price * 0.1;

// Display the result
resultContainer.innerHTML = '<p>Price: ' + price + '</p><p>Commission: ' + commission + '</p>';
});
});

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

<style>
/* App CSS Goes Here */
body {
background-color: #f8f9fa;
font-family: 'Arial', sans-serif;
}

.container {
max-width: 600px;
margin: 0 auto;
padding: 20px;
}

h1 {
text-align: center;
margin-bottom: 30px;
}

.form-group {
margin-bottom: 20px;
}

.form-group label {
font-weight: bold;
}

.form-group input {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
font-size: 16px;
}

#calculate {
width: 100%;
padding: 10px;
font-size: 16px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
}

#calculate:hover {
background-color: #0056b3;
}

#result-container {
margin-top: 20px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
background-color: #fff;
}

#result-container p {
margin-bottom: 10px;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1>Machine Rental Price Calculator</h1>

<div class="form-group">
<label for="machines">Number of Machines:</label>
<input type="number" id="machines" placeholder="Enter number of machines">
</div>

<div class="form-group">
<label for="months">Number of Months:</label>
<input type="number" id="months" placeholder="Enter number of months">
</div>

<button id="calculate">Calculate</button>

<div id="result-container"></div>
</div>
</body>
</html>