function calculateAndPrint() {
const inputValue = document.getElementById(‘inputValue’).value;
if (inputValue === ”) {
alert(‘Please enter a value.’);
return;
}
// Sample calculation (you can modify it based on the actual use case)
const result = inputValue * 2; // Example: doubling the entered value
document.getElementById(‘calculationResult’).value = result;
// Print functionality
const printWindow = window.open(”, ”, ‘width=600,height=400’);
printWindow.document.write(”);
printWindow.document.write(‘