body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1 {
color: #333;
}
form {
margin-bottom: 20px;
}
label {
display: block;
margin-top: 10px;
}
input {
margin-bottom: 10px;
padding: 5px;
width: 100%;
box-sizing: border-box;
}
button {
background-color: #4CAF50;
color: white;
border: none;
padding: 10px 20px;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
#result {
font-size: 1.2em;
font-weight: bold;
}
Ceiling Tiles Quantity Calculator
Prepared By: Parag Kamlakar Pal – Owner of www.civilnotess.com
Total Number of Tiles:
function calculateTiles() {
// Get input values
const ceilingLength = parseFloat(document.getElementById(‘ceilingLength’).value);
const ceilingWidth = parseFloat(document.getElementById(‘ceilingWidth’).value);
const tileLength = parseFloat(document.getElementById(’tileLength’).value);
const tileWidth = parseFloat(document.getElementById(’tileWidth’).value);
const wastePercentage = parseFloat(document.getElementById(‘wastePercentage’).value) / 100;
// Calculate areas
const ceilingArea = ceilingLength * ceilingWidth;
const tileArea = tileLength * tileWidth;
// Calculate number of tiles
let numberOfTiles = ceilingArea / tileArea;
// Account for waste
numberOfTiles *= (1 + wastePercentage);
// Round up
numberOfTiles = Math.ceil(numberOfTiles);
// Display result
document.getElementById(‘result’).textContent = `Total Number of Tiles: ${numberOfTiles}`;
}

