/* calcular la severidad del EPOC segun medición del VEF1 */ var VEF1 = prompt("Ingrese el VEF1"); var severidad = ""; if (VEF1 >= 80) { severidad = "Leve"; } else if (VEF1 >= 50 && VEF1 < 80) { severidad = "Moderado"; } else if (VEF1 >= 30 && VEF1 < 50) { severidad = "Severo"; } else if (VEF1 < 30) { severidad = "Muy Severo"; } var resultado = document.createElement('div'); resultado.innerHTML = "La severidad del EPOC es: " + severidad; document.body.appendChild(resultado);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter