Calculator Tools Calculator Tools
Create

Production Cost Calculator

Sep 5, 2023

About this app

Calculate production costs of canned sweet corn based on basic data sheet and input data.

Production Cost Calculator Production Cost Calculator Raw Material Cost: Labor Cost: Overhead Cost: Units Produced: Calculate Results Total Cost: $0.00 Cost Per Unit: $0.00

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>Production Cost Calculator</title>
<meta name="description" content="Calculate production costs of canned sweet corn based on basic data sheet and input data.">
<meta name="keywords" content="production cost calculator, canned sweet corn, cost calculation">

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

<link href="https://fonts.googleapis.com/css?family=Roboto" 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() {
// Function to calculate the production cost
function calculateCost() {
// Get the input values
var rawMaterialCost = parseFloat($("#rawMaterialCost").val());
var laborCost = parseFloat($("#laborCost").val());
var overheadCost = parseFloat($("#overheadCost").val());
var unitsProduced = parseFloat($("#unitsProduced").val());

// Calculate the total cost
var totalCost = rawMaterialCost + laborCost + overheadCost;

// Calculate the cost per unit produced
var costPerUnit = totalCost / unitsProduced;

// Display the results
$("#totalCost").text(totalCost.toFixed(2));
$("#costPerUnit").text(costPerUnit.toFixed(2));
}

// Event listener for the calculate button
$("#calculateBtn").click(function() {
calculateCost();
});
});

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

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

.container {
max-width: 500px;
margin: 0 auto;
padding: 30px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 5px;
}

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

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

label {
font-weight: bold;
}

input[type="number"] {
width: 100%;
padding: 10px;
border-radius: 5px;
border: 1px solid #ccc;
}

.result {
margin-top: 20px;
padding: 10px;
background-color: #f2f2f2;
border-radius: 5px;
text-align: center;
}

.btn {
display: block;
width: 100%;
padding: 10px;
background-color: #333;
color: #fff;
text-align: center;
text-decoration: none;
border-radius: 5px;
cursor: pointer;
}

.btn:hover {
background-color: #111;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1>Production Cost Calculator</h1>
<div class="form-group">
<label for="rawMaterialCost">Raw Material Cost:</label>
<input type="number" id="rawMaterialCost" step="0.01" placeholder="Enter raw material cost">
</div>
<div class="form-group">
<label for="laborCost">Labor Cost:</label>
<input type="number" id="laborCost" step="0.01" placeholder="Enter labor cost">
</div>
<div class="form-group">
<label for="overheadCost">Overhead Cost:</label>
<input type="number" id="overheadCost" step="0.01" placeholder="Enter overhead cost">
</div>
<div class="form-group">
<label for="unitsProduced">Units Produced:</label>
<input type="number" id="unitsProduced" step="1" placeholder="Enter units produced">
</div>
<button id="calculateBtn" class="btn">Calculate</button>
<div class="result">
<h2>Results</h2>
<p>Total Cost: $<span id="totalCost">0.00</span></p>
<p>Cost Per Unit: $<span id="costPerUnit">0.00</span></p>
</div>
</div>
</body>
</html>