Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function calculo () {
- var self_service = document.forms[0].self.value;
- var suco = document.forms[0].suco.value;
- var sobremesa = document.forms[0].sobremesa.value;
- var nome = document.forms[0].nome.value;
- var totalSelfService = 30 * (self_service / 1000);
- var totalSuco = suco * 4;
- var totalSobremesa = sobremesa * 4;
- var total = totalSelfService + totalSobremesa + totalSuco;
- document.getElementById("Fatura").innerHTML = (nome + "</br></br>Consumiu:</br></br>" + self_service + " gramas no self-service R$ " + totalSelfService + " reais</br>" + suco + " sucos R$ " + totalSuco + " reais</br>" + sobremesa + " pratos de sobremesa R$ " + totalSobremesa + " reais</br>Total " + total + " reais</br>");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement